This is the mail archive of the 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] Prevent the linker from crashing.


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  <>

	* 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);

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