bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/31158] ld: Should --gc-sections respect RHS of a symbol assignme


From: amodra at gmail dot com
Subject: [Bug ld/31158] ld: Should --gc-sections respect RHS of a symbol assignment?
Date: Thu, 14 Dec 2023 01:30:02 +0000

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

--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
(In reply to Fangrui Song from comment #0)
> Perhaps gold and lld's behavior make more sense?
No.  There is no use of x or bar in your testcase.

If you change it to
cat > a.s <<e
.globl _start; _start: .dc.a x
.section .rodata.bar, "a"
.global bar; bar: .quad 0x1122334455667788
e
echo 'x = bar;' > a.t
ld.bfd --gc-sections a.o a.t -o a.bfd

then .rodata.bar is kept.  I believe that is the proper behaviour, and the
other linkers wrong.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]