[PATCH] GOLD: emit STT_FILE symbols when more than 64k sections

Cary Coutant ccoutant@gmail.com
Mon Dec 5 18:44:00 GMT 2016
> a simple thinko in object.cc prevents from emitting STT_FILE symbols when --gc-sections is used and when the file contains more than 64K symbols.  See the testcase.
>
> No regression on x86-64 linux.
>
> Ok to commit ?

Not quite. The real problem was that the is_ordinary flag wasn't being
checked before we use shndx, and the effect was that any SHN_ABS
symbol may have been incorrectly omitted. I've applied the attached
patch.

Thanks for finding the problem, and for providing a test case!

-cary


2016-12-05  Cary Coutant  <ccoutant@gmail.com>
            Tristan Gingold  <gingold@adacore.com>

gold/
        * object.cc (Sized_relobj_file::do_count_local_symbols): Check
        is_ordinary before using shndx.
        * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/file_in_many_sections.c: New source file.
        * testsuite/file_in_many_sections_test.sh: New script.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-sym.patch
Type: application/octet-stream
Size: 4949 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20161205/7e3f36d6/attachment.obj>


More information about the Binutils mailing list