Properly place the NULL STT_FILE symbol
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 15 Feb 2015 04:17:28 +0000 (20:17 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 16 Feb 2015 12:54:45 +0000 (04:54 -0800)
commit35f82954b5e46ef5f56653d4f3aa0d1236f558da
tree69a8919654119418b741d0f30f6641257cc2490c
parent171e6b1cf621bff93e1aea3fe76bdaa6132df9f6
Properly place the NULL STT_FILE symbol

We output a NULL STT_FILE symbol for forced local symbols so that they
are not associated with the STT_FILE symbol for real local symbols. This
patch makes sure that the NULL STT_FILE symbol is placed before forced
local symbols.

bfd/

PR ld/17975
* elflink.c (elf_link_output_extsym): Only check filesym_count
when outputting a NULL FILE symbol.  Set second_pass_sym to
h->forced_local && !h->root.linker_def.

ld/testsuite/

PR ld/17975
* ld-i386/tlsbin-nacl.rd: Likewise.
* ld-i386/tlsbin.rd: Likewise.
* ld-i386/tlsbindesc-nacl.rd: Likewise.
* ld-i386/tlsbindesc.rd: Likewise.
* ld-i386/tlsdesc-nacl.rd: Likewise.
* ld-i386/tlsdesc.rd: Likewise.
* ld-i386/tlsnopic-nacl.rd: Likewise.
* ld-i386/tlsnopic.rd: Likewise.
* ld-i386/tlspic-nacl.rd: Likewise.
* ld-i386/tlspic.rd: Likewise.
* ld-x86-64/tlsbin-nacl.rd: Likewise.
* ld-x86-64/tlsbin.rd: Likewise.
* ld-x86-64/tlsbindesc-nacl.rd: Likewise.
* ld-x86-64/tlsbindesc.rd: Likewise.
* ld-x86-64/tlsdesc-nacl.rd: Likewise.
* ld-x86-64/tlsdesc.rd: Likewise.
* ld-x86-64/tlspic-nacl.rd: Likewise.
* ld-x86-64/tlspic.rd: Likewise.
19 files changed:
bfd/elflink.c
ld/testsuite/ld-i386/tlsbin-nacl.rd
ld/testsuite/ld-i386/tlsbin.rd
ld/testsuite/ld-i386/tlsbindesc-nacl.rd
ld/testsuite/ld-i386/tlsbindesc.rd
ld/testsuite/ld-i386/tlsdesc-nacl.rd
ld/testsuite/ld-i386/tlsdesc.rd
ld/testsuite/ld-i386/tlsnopic-nacl.rd
ld/testsuite/ld-i386/tlsnopic.rd
ld/testsuite/ld-i386/tlspic-nacl.rd
ld/testsuite/ld-i386/tlspic.rd
ld/testsuite/ld-x86-64/tlsbin-nacl.rd
ld/testsuite/ld-x86-64/tlsbin.rd
ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd
ld/testsuite/ld-x86-64/tlsbindesc.rd
ld/testsuite/ld-x86-64/tlsdesc-nacl.rd
ld/testsuite/ld-x86-64/tlsdesc.rd
ld/testsuite/ld-x86-64/tlspic-nacl.rd
ld/testsuite/ld-x86-64/tlspic.rd