[PATCH] Fix --gc-sections for MIPS.
David Daney
ddaney@avtrex.com
Sun Jul 31 05:43:00 GMT 2005
ld --gc-sections was causing an assertion failure in elfxx-mips.c:
mips_elf_sort_hash_table().
The problem was that elf_gc_sweep() was setting dynsymcount incorrectly.
It was not accounting for the unused NULL entry as is done in
_bfd_elf_link_renumber_dynsyms().
The attached patch adds the missing logic to elf_gc_sweep().
The problem was not fatal in all architectures as
_bfd_elf_link_renumber_dynsyms() is being called after elf_gc_sweep()
and cleaned up the mess.
On MIPS mips_elf_sort_hash_table() is called while dynsymcount had the
incorrect value causing the assertion failure.
Tested on i686-pc-linux-gnu configured as --target=mipsel-linux: make
-k check no new failures.
2005-07-30 David Daney <ddaney@avtrex.com>
* elflink.c (elf_gc_sweep): Set dynsymcount to correct value.
OK to commit?
David Daney
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b.c
Type: text/x-csrc
Size: 737 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050731/00ae13e5/attachment.bin>
More information about the Binutils
mailing list