https://sourceware.org/bugzilla/show_bug.cgi?id=18147

--- Comment #3 from Alan Modra <amodra at gmail dot com> ---
Here is my thinking, FWIW.

What is the value of an undefined symbol?

Why should a branch to zero not report an overflow, if there is indeed an
overflow?

Try linking the same testcase on x86_64, but with -Ttext=0x100000000.

ld/ld-new -o pr18147 pr18147.o --unresolved-symbols=ignore-all
-Ttext=0x100000000
ld/ld-new: warning: cannot find entry symbol _start; defaulting to
0000000100000000
pr18147.o: In function `f1':
pr18147.c:(.text+0x3): relocation truncated to fit: R_X86_64_PC32 against
undefined symbol `f2'

gold on x86_64 doesn't report an error, but that is simply because gold on
x86_64 doesn't report relocation overflows, a serious defect IMO.

gold/ld-new -o pr18147 pr18147.o --defsym f2=0 -Ttext=0x100000000
=> no error

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to