PATCH: fix crash when --gc-section discard the TLS segment

Nick Clifton nickc@redhat.com
Tue Nov 20 15:07:00 GMT 2007


Hi Tristan,

> this following tiny program crashes ld (at least on x86 linux):

Thanks for reporting this bug.  In the future, for bugs like this, please could 
use the bugzilla reporting system:

   http://sourceware.org/bugzilla/

> Here is a patch.

Great - thanks for creating this, and bonus points for creating a test case too.

> bfd:
> 2007-11-16  Tristan Gingold  <gingold@adacore.com>
> 
>         * elflink.c (elf_link_output_extsym): Weaken assertion: if 
> --gc-section
>         is set, there may be no TLS segment.

Approved and applied.  (I had to apply it locally to test it, so I decided to 
check it in myself).

> ld/testsuite:
> 2007-11-16  Tristan Gingold  <gingold@adacore.com>
> 
>         * ld-elf/tls_gc.s: New test.
>         * ld-elf/elf.exp: Add tls_gc test.

Also approved and applied.

> (The set of platforms that should run the test should be updated).

Indeed.  In fact what you need is a copy of the check_gc_sections_available 
from gcc/testsuite/lib/target-supports.exp.  So I have done that and add it as 
the attached patch.

Cheers
   Nick

ld/testsuite/ChangeLog
2007-11-20  Nick Clifton  <nickc@redhat.com>

	* lib/ld-lib.exp (check_gc_sections_available): New proc, based
	on the version in gcc/testsuite/lib/target-supports.exp.
	* lib/ld-elf/eld.exp: Use check_gc_sections_available.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-lib.exp.patch
Type: text/x-patch
Size: 1781 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071120/96d95371/attachment.bin>


More information about the Binutils mailing list