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]

Re: PATCH: PR ld/11937: ld --build-id crash with non-ELF input


On Sun, Aug 22, 2010 at 5:17 AM, Alan Modra <amodra@gmail.com> wrote:
> On Sat, Aug 21, 2010 at 12:39:35PM -0700, H.J. Lu wrote:
>> 2010-08-21 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>
>> ? ? ? PR ld/11937
>> ? ? ? * emultempl/elf32.em (_after_open): Find an ELF input for
>> ? ? ? --build-id and --eh-frame-hdr.
>
> OK.
>

I checked in this small update to search just one .eh_frame section.


-- 
H.J.
---
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 886bd89..55fd8e3 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,6 +1,12 @@
 2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>

 	PR ld/11937
+	* emultempl/elf32.em (_after_open): Find one .eh_frame section
+	for --eh-frame-hdr.
+
+2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/11937
 	* emultempl/elf32.em (_after_open): Find an ELF input for
 	--build-id and --eh-frame-hdr.

diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index bf4359d..aa9d787 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1132,11 +1132,16 @@ gld${EMULATION_NAME}_after_open (void)
 	{
 	  if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
 	    elfbfd = abfd;
-	  s = bfd_get_section_by_name (abfd, ".eh_frame");
-	   if (s && s->size > 8 && !bfd_is_abs_section (s->output_section))
-	     warn_eh_frame = TRUE;
-	   if (elfbfd && warn_eh_frame)
-	     break;
+	  if (!warn_eh_frame)
+	    {
+	      s = bfd_get_section_by_name (abfd, ".eh_frame");
+	      warn_eh_frame
+		= (s
+		   && s->size > 8
+		   && !bfd_is_abs_section (s->output_section));
+	    }
+	  if (elfbfd && warn_eh_frame)
+	    break;
 	}
       if (elfbfd)
 	{


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