[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script |
Date: |
Mon, 12 Jun 2017 20:10:46 +0000 |
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> ---
address@hidden 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
address@hidden xxx]$ cat x.t
SECTIONS {
.foo : {
PROVIDE (__start_scnfoo = .);
*(scnfoo)
PROVIDE (__stop_scnfoo = .);
}
}
address@hidden 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
address@hidden xxx]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/21571] New: --gc-sections doesn', hjl.tools at gmail dot com, 2017/06/12
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script,
hjl.tools at gmail dot com <=
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script, hjl.tools at gmail dot com, 2017/06/12
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script, amonakov at gmail dot com, 2017/06/13
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script, cvs-commit at gcc dot gnu.org, 2017/06/13
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script, hjl.tools at gmail dot com, 2017/06/13
- [Bug ld/21571] --gc-sections doesn't work with PROVIDE in linker script, cvs-commit at gcc dot gnu.org, 2017/06/16