This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi,

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

$ more t.c
__thread char * tls_var;

int main (void)
{
  return 0;
}

gcc -c t.c -fdata-section
gcc -o t t.o -Wl,--gc-sections

(use of -fdata-section is not required).

Here is a patch.

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.


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.

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

Attachment: tls.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]