https://sourceware.org/bugzilla/show_bug.cgi?id=21571
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|--gc-sections doesn' |--gc-sections doesn't work
| |with PROVIDE in linker
| |script
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-6 xxx]$ cat x.s
.section scnfoo,"aw",@progbits
.zero 0x10
.globl bar
.data
.align 8
.type bar, @object
.size bar, 8
bar:
.dc.a __start_scnfoo
.dc.a __stop_scnfoo
[hjl@gnu-6 xxx]$ cat x.t
SECTIONS {
.foo : {
PROVIDE (__start_scnfoo = .);
*(scnfoo)
PROVIDE (__stop_scnfoo = .);
}
}
[hjl@gnu-6 xxx]$ make
as -o x.o x.s
./ld --gc-sections --print-gc-sections -shared -z defs -T x.t -o x.so x.o
./ld: Removing unused section 'scnfoo' in file 'x.o'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is wrong.
readelf -sSW x.so | grep foo
1: 00000000000001d0 0 NOTYPE GLOBAL DEFAULT 6 __stop_scnfoo
2: 00000000000001d0 0 NOTYPE GLOBAL DEFAULT 6 __start_scnfoo
9: 00000000000001d0 0 NOTYPE GLOBAL DEFAULT 6 __stop_scnfoo
10: 00000000000001d0 0 NOTYPE GLOBAL DEFAULT 6 __start_scnfoo
[hjl@gnu-6 xxx]$
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils