-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[ELF] Detect convergence of output section addresses #93888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,8 +68,8 @@ | |
# RUN: symbol = .; \ | ||
# RUN: .data : { *(.data) } > ram \ | ||
# RUN: }' > %t.script | ||
# RUN: not ld.lld -T %t.script %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR_OVERFLOW %s | ||
# ERR_OVERFLOW: error: section '.data' will not fit in region 'ram': overflowed by 2 bytes | ||
# RUN: not ld.lld -T %t.script %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=NOT_CONVERGE %s | ||
# NOT_CONVERGE: error: address (0x14) of section '.text' does not converge | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this example expected to not converge? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. The memory region is |
||
|
||
nop | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# REQUIRES: x86 | ||
# RUN: rm -rf %t && split-file %s %t && cd %t | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o | ||
|
||
# RUN: not ld.lld a.o -T a.lds 2>&1 | FileCheck %s --implicit-check-not=error: | ||
# CHECK: error: address (0x6014) of section '.text' does not converge | ||
|
||
# RUN: ld.lld a.o -T b.lds --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=CHECK2 --implicit-check-not=warning: | ||
# CHECK2: warning: address (0x5014) of section '.text' does not converge | ||
# CHECK2: warning: assignment to symbol a does not converge | ||
|
||
#--- a.s | ||
.globl _start | ||
_start: .space 4 | ||
.data; .byte 0 | ||
|
||
#--- a.lds | ||
SECTIONS { | ||
. = 0x1000; | ||
.text ADDR(.data) + 0x1000 : { *(.text) } | ||
.data : { *(.data) } | ||
} | ||
|
||
#--- b.lds | ||
SECTIONS { | ||
. = 0x1000; | ||
.text text : { *(.text) } | ||
.data : { | ||
*(.data) | ||
x = ADDR(.text); | ||
a = b; | ||
b = c; | ||
## Absolute symbol; not converging | ||
c = ABSOLUTE(ADDR(.text)); | ||
} | ||
text = ADDR(.data) + 0x1000; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.