From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: [PATCH] bfin: Skip non SEC_ALLOC section
Date: Fri, 5 Jun 2020 05:32:03 -0700 [thread overview]
Message-ID: <CAMe9rOqLEz0CZRVMb1wkBkgQjg8bqYHWXvc=0PhDZ=hyFDVozg@mail.gmail.com> (raw)
In-Reply-To: <20200605030705.GT29024@bubble.grove.modra.org>
[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]
On Thu, Jun 4, 2020 at 8:07 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Thu, Jun 04, 2020 at 10:11:20PM +0930, Alan Modra wrote:
> > On Thu, Jun 04, 2020 at 04:24:36AM -0700, H.J. Lu wrote:
> > > Here is the updated patch. OK for master?
> >
> > Looks OK to me.
>
> This patch may have caused the following. The first bfin fail is due
> to bfinfdpic_relocs_info_for_local returning NULL since relocs_info is
> NULL, which in turn is because check_relocs isn't called and thus
> doesn't create a got section. _bfin_create_got_section creates the
> relocs_info hash table.
>
> bfin-linux-uclibc +FAIL: ld-elf/compress1a
> bfin-linux-uclibc +FAIL: ld-elf/compressed1a
> bfin-linux-uclibc +FAIL: ld-elf/pr12851
> bfin-linux-uclibc +FAIL: ld-elf/pr24526
> bfin-linux-uclibc +FAIL: ld-elf/pr25021
> bfin-linux-uclibc +FAIL: ld-elf/stab
> bfin-linux-uclibc +FAIL: --gc-sections with multiple debug sections for a function section
> bfin-linux-uclibc +FAIL: --gc-sections with relocations in debug section
> bfin-linux-uclibc +FAIL: Preserve default . = 0
> bfin-linux-uclibc +FAIL: Preserve explicit . = 0
>
I am checking in this patch.
--
H.J.
[-- Attachment #2: 0001-bfin-Skip-non-SEC_ALLOC-section.patch --]
[-- Type: text/x-patch, Size: 1229 bytes --]
From 981f151804e47290f4dcff507aeb530b3334ac17 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 5 Jun 2020 05:30:25 -0700
Subject: [PATCH] bfin: Skip non SEC_ALLOC section
* elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
section.
---
bfd/ChangeLog | 5 +++++
bfd/elf32-bfin.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 011a49d5ec..4971b87828 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
+ section.
+
2020-06-05 Nick Clifton <nickc@redhat.com>
* pdp11.c (aout_link_add_symbols): Fix use before initialisation
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index b06daf507e..e067cdeaad 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -2614,6 +2614,9 @@ bfinfdpic_relocate_section (bfd * output_bfd,
case R_BFIN_FUNCDESC_GOTOFFLO:
case R_BFIN_FUNCDESC:
case R_BFIN_FUNCDESC_VALUE:
+ if ((input_section->flags & SEC_ALLOC) == 0)
+ break;
+
if (h != NULL)
picrel = bfinfdpic_relocs_info_for_global (bfinfdpic_relocs_info
(info), input_bfd, h,
--
2.26.2
prev parent reply other threads:[~2020-06-05 12:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 20:38 [PATCH] ELF: Don't check relocations in non-loaded, non-alloced sections H.J. Lu
2020-06-03 0:05 ` Fangrui Song
[not found] ` <MWHPR12MB14567E24AED5430AAE2497A8CB880@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-06-03 1:29 ` H.J. Lu
2020-06-03 16:48 ` V2 " H.J. Lu
2020-06-03 18:55 ` V3 " H.J. Lu
2020-06-04 7:47 ` Alan Modra
2020-06-04 11:24 ` V4 " H.J. Lu
2020-06-04 12:41 ` Alan Modra
2020-06-05 3:07 ` Alan Modra
2020-06-05 12:32 ` H.J. Lu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOqLEz0CZRVMb1wkBkgQjg8bqYHWXvc=0PhDZ=hyFDVozg@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).