public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] Prevent the linker from crashing.
@ 2006-09-08 18:45 Kazu Hirata
  2006-10-02 20:25 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Kazu Hirata @ 2006-09-08 18:45 UTC (permalink / raw)
  To: binutils; +Cc: dan, joseph

Hi,

Attached is a patch to prevent the linker from crashing.  References
to TLS symbols are discarded from the --just-syms file; other
references should resolve normally.

Tested on powerpc.  OK to apply?

Kazu Hirata

2006-09-08  Daniel Jacobowitz  <dan@codesourcery.com>

	* elflink.c (_bfd_elf_merge_symbol): Discard references to TLS
	symbols from the --just-syms file.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.228
diff -u -r1.228 elflink.c
--- bfd/elflink.c	7 Sep 2006 17:16:31 -0000	1.228
+++ bfd/elflink.c	8 Sep 2006 18:36:07 -0000
@@ -832,6 +832,15 @@
   sec = *psec;
   bind = ELF_ST_BIND (sym->st_info);
 
+  /* Silently discard TLS symbols from --just-syms.  There's no way to
+     combine a static TLS block with a new TLS block for this executable.  */
+  if (ELF_ST_TYPE (sym->st_info) == STT_TLS
+      && sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+    {
+      *skip = TRUE;
+      return TRUE;
+    }
+
   if (! bfd_is_und_section (sec))
     h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE);
   else

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Prevent the linker from crashing.
  2006-09-08 18:45 [patch] Prevent the linker from crashing Kazu Hirata
@ 2006-10-02 20:25 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-10-02 20:25 UTC (permalink / raw)
  To: Kazu Hirata; +Cc: binutils, joseph

On Fri, Sep 08, 2006 at 11:45:12AM -0700, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to prevent the linker from crashing.  References
> to TLS symbols are discarded from the --just-syms file; other
> references should resolve normally.
> 
> Tested on powerpc.  OK to apply?
> 
> Kazu Hirata
> 
> 2006-09-08  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* elflink.c (_bfd_elf_merge_symbol): Discard references to TLS
> 	symbols from the --just-syms file.

OK, and thanks for submitting.  I'll self-approve this because I can't
see any way it could be worse than the current state.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-02 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-08 18:45 [patch] Prevent the linker from crashing Kazu Hirata
2006-10-02 20:25 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).