-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] - Check that output sections fit in address space.
Added checks to test that we do not produce output where VA of sections overruns the address space available. Differential revision: https://reviews.llvm.org/D43820 llvm-svn: 329063
- Loading branch information
George Rimar
committed
Apr 3, 2018
1 parent
8fcd04b
commit 1fc9f39
Showing
4 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# REQUIRES: x86 | ||
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t.o | ||
|
||
# RUN: echo "SECTIONS { . = 0xfffffff1;" > %t.script | ||
# RUN: echo " .bar : { *(.bar*) } }" >> %t.script | ||
# RUN: not ld.lld -o %t.so --script %t.script %t.o 2>&1 | FileCheck %s -check-prefix=ERR | ||
|
||
## .bar section has data in [0xfffffff1, 0xfffffff1 + 0x10] == [0xffffff1, 0x1]. | ||
## Check we can catch this overflow. | ||
# ERR: error: section .bar at 0xFFFFFFF1 of size 0x10 exceeds available address space | ||
|
||
.section .bar,"ax",@progbits | ||
.zero 0x10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# REQUIRES: x86 | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o | ||
|
||
# RUN: echo "SECTIONS { . = 0xfffffffffffffff1;" > %t.script | ||
# RUN: echo " .bar : { *(.bar*) } }" >> %t.script | ||
# RUN: not ld.lld -o %t.so --script %t.script %t.o 2>&1 | FileCheck %s -check-prefix=ERR | ||
|
||
## .bar section has data in [0xfffffffffffffff1, 0xfffffffffffffff1 + 0x10] == | ||
## [0xfffffffffffffff1, 0x1]. Check we can catch this overflow. | ||
# ERR: error: section .bar at 0xFFFFFFFFFFFFFFF1 of size 0x10 exceeds available address space | ||
|
||
.section .bar,"ax",@progbits | ||
.zero 0x10 |