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]

[GOLD][ARM] non-linked ARM EXIDX sections


Hi Doug,

I got the problem with the ARM EXIDX sections, when I built the glibc
library. So, there is some object files during a build of glibc, which
contain the non-linked EXIDX sections (without linked text segment).
GOLD fires an error in this situation like this -- 

error: EXIDX section 9 in /opt/crosstool/build-gold/work/obj.glibc/elf/
librtld.os has no linked text section

but LD links those files without any problems. I have checked out how LD
handles it and I found that LD just skips that kind of EXIDX sections
silently. I suppose, we should do the same thing in GOLD. What do you
think? Something like as it proposed in the attached file.

-Viktor.
Index: arm.cc
===================================================================
RCS file: /cvs/src/src/gold/arm.cc,v
retrieving revision 1.79
diff -u -p -r1.79 arm.cc
--- arm.cc	9 Feb 2010 20:29:44 -0000	1.79
+++ arm.cc	10 Feb 2010 23:48:45 -0000
@@ -5436,6 +5436,11 @@ Arm_output_section<big_endian>::fix_exid
 	    Arm_relobj<big_endian>::as_arm_relobj(p->relobj());
 	  const Arm_exidx_input_section* exidx_input_section =
 	    arm_relobj->exidx_input_section_by_shndx(p->shndx());
+      if (exidx_input_section == NULL)
+      {
+        p->relobj()->set_output_section(p->shndx(), NULL);
+        continue;
+      }
 	  gold_assert(exidx_input_section != NULL);
 	  unsigned int text_shndx = exidx_input_section->link();
 	  gold_assert(symtab->is_section_folded(p->relobj(), text_shndx));
@@ -5972,14 +5977,9 @@ Arm_relobj<big_endian>::make_exidx_input
   // Link .text section to its .ARM.exidx section in the same object.
   unsigned int text_shndx = this->adjust_shndx(shdr.get_sh_link());
 
-  // Issue an error and ignore this EXIDX section if it does not point
-  // to any text section.
+  // Ignore this EXIDX section if it does not point to any text section.
   if (text_shndx == elfcpp::SHN_UNDEF)
-    {
-      gold_error(_("EXIDX section %u in %s has no linked text section"),
-		 shndx, this->name().c_str());
-      return;
-    }
+    return;
   
   // Issue an error and ignore this EXIDX section if it points to a text
   // section already has an EXIDX section.

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