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]

complex relocations and "ld -r"


If you do a relocatable link with complex relocations, elflink.c tries
to resolve the complex relocations so as to have an "absolute value"
for them.  Obviously, nothing is absolute in a relocatable link, but
the attempt causes an error about referencing undefined symbols.  Is
it sufficient to just skip that evaluation for relocatable links?


Index: elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.331
diff -p -U3 -r1.331 elflink.c
--- elflink.c	13 Mar 2009 11:34:42 -0000	1.331
+++ elflink.c	25 Mar 2009 20:59:44 -0000
@@ -9329,7 +9329,8 @@ elf_link_input_bfd (struct elf_final_lin
 					       sym, *ps);
 		}
 
-	      if (s_type == STT_RELC || s_type == STT_SRELC)
+	      if ((s_type == STT_RELC || s_type == STT_SRELC)
+		  && !finfo->info->relocatable)
 		{
 		  bfd_vma val;
 		  bfd_vma dot = (rel->r_offset


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