aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-discard
diff options
context:
space:
mode:
authorNelson Chu <nelson@rivosinc.com>2025-02-08 16:33:37 +0800
committerNelson Chu <nelson@rivosinc.com>2025-03-07 10:51:08 +0800
commit4295841be4392fcff33a1efee6d4345063021e6b (patch)
treeb7678e24660ef74d27ca6bc74617005187e36fad /ld/testsuite/ld-discard
parentd07a59a5ca830bf74705471f6bea6db1a47da2b5 (diff)
downloadbinutils-master.zip
binutils-master.tar.gz
binutils-master.tar.bz2
RISC-V: Go PLT for CALL/JUMP/RVC_JUMP if `h->plt.offset' isn't -1HEADmaster
I got an request about the undefined behaviors, considering the following case, $ cat test.c void main () { foo(); } $ cat lib.h void foo(void); $ riscv64-unknown-linux-gnu-gcc test.c riscv64-unknown-linux-gnu/bin/ld: /tmp/ccRO8fJl.o: in function `main': test.c:(.text+0x8): undefined reference to `foo' collect2: error: ld returned 1 exit status $ riscv64-unknown-linux-gnu-gcc test.c -Wl,--unresolved-symbols=ignore-in-object-files $ qemu-riscv64 a.out Segmentation fault (core dumped) Testing with x86 and aarch64, they won't get the segfault since they go plt for the undefined foo symbol. So, after applying this patch, I can get the following too, $ qemu-riscv64 a.out a.out: symbol lookup error: a.out: undefined symbol: foo The change of this patch should only affect the call behavior, which refer to an undefined (weak) symbol, when building an dynamic executable. I think the pic/pie behavior won't be affected as usual.
Diffstat (limited to 'ld/testsuite/ld-discard')
0 files changed, 0 insertions, 0 deletions