This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] PR ld/18808: aborting at bfd/elf64-x86-64.c:3791 in elf_x86_64_relocate_section
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 11 Aug 2015 19:07:00 -0700
- Subject: Re: [committed, PATCH] PR ld/18808: aborting at bfd/elf64-x86-64.c:3791 in elf_x86_64_relocate_section
- Authentication-results: sourceware.org; auth=none
- References: <20150811200042 dot GA23505 at intel dot com> <20150812005833 dot GC23078 at bubble dot grove dot modra dot org>
On Tue, Aug 11, 2015 at 5:58 PM, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Aug 11, 2015 at 01:00:42PM -0700, H.J. Lu wrote:
>> + if ((input_section->flags & SEC_ALLOC) == 0)
>> + {
>> + /* Dynamic relocs are not propagated for SEC_DEBUGGING
>> + sections because such sections are not SEC_ALLOC and
>> + thus ld.so will not process them. */
>> + if ((input_section->flags & SEC_DEBUGGING) != 0)
>> + break;
>
> Shouldn't this be "continue"?
>
You are right. I checked in this to fix it.
Thanks.
--
H.J.
From 0eace2105dc6c005fdc908414ad564d318b71540 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 11 Aug 2015 19:04:38 -0700
Subject: [PATCH] Properly skip IFUNC relocations in debug sections
Use "continue" instead of "break" to skip IFUNC relocations in debug
sections.
* elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
relocations in debug sections.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
---
bfd/ChangeLog | 6 ++++++
bfd/elf32-i386.c | 2 +-
bfd/elf64-x86-64.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1e02625..2f850e7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
+ relocations in debug sections.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
2015-08-11 Jiong Wang <jiong.wang@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index fb87421..98902ac 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3509,7 +3509,7 @@ elf_i386_relocate_section (bfd *output_bfd,
sections because such sections are not SEC_ALLOC and
thus ld.so will not process them. */
if ((input_section->flags & SEC_DEBUGGING) != 0)
- break;
+ continue;
abort ();
}
else if (h->plt.offset == (bfd_vma) -1)
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 4b83032..b3c8522 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3792,7 +3792,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
sections because such sections are not SEC_ALLOC and
thus ld.so will not process them. */
if ((input_section->flags & SEC_DEBUGGING) != 0)
- break;
+ continue;
abort ();
}
else if (h->plt.offset == (bfd_vma) -1)
--
2.4.3