[FR-V, installed] fix crash on missing TLS section

Alexandre Oliva aoliva@redhat.com
Mon Feb 7 17:48:00 GMT 2005


A program containing object files that contained TLS relocations
referencing (ABS+addend) could crash at link time if no TLS symbols
were defined in the executable or shared lib being linked.  Since such
relocations only make sense to access module-local TLS symbols, I
figured it was perfectly legitimate to issue an error message if no
TLS symbols were defined (i.e., no TLS section is present).

This required tweaking a little bit the error handling of another
invalid condition that used to be the only error condition in
_frvfdpic_elf_emit_got_relocs_plt_entries().

While at that, I found out I no longer needed the tests in
FRVFDPIC_SYM_LOCAL to get *ABS*+offset relocations to bind locally in
e.g. #tlsmoff relocations, so I took it out.

Here's the patch I'm checking in.  Tested building a working glibc for
frv-linux-gnu on x86_64-linux-gnu.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-frv-report-missing-tls-section.patch
Type: text/x-patch
Size: 4706 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050207/907d9276/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Binutils mailing list