From: Nick Clifton <nickc@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] HPPA64 linker: Do not force the generation of DT_FLAGS for Linux targets.
Date: Thu, 18 Apr 2024 12:26:00 +0000 (GMT) [thread overview]
Message-ID: <20240418122600.BB80C3849AF1@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31d5afc19d98869aa13c3197f55b8a208fd19da2
commit 31d5afc19d98869aa13c3197f55b8a208fd19da2
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Apr 18 13:24:42 2024 +0100
HPPA64 linker: Do not force the generation of DT_FLAGS for Linux targets.
PR 30743
Diff:
---
bfd/elf64-hppa.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 041ab29c3b4..2d08bf37155 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -27,6 +27,10 @@
#include "elf64-hppa.h"
#include "libiberty.h"
+/* Target vectors for HPUX and non-HPUX versions of HPPA ELF binaries. */
+extern const bfd_target hppa_elf64_vec;
+extern const bfd_target hppa_elf64_linux_vec;
+
#define ARCH_SIZE 64
#define PLT_ENTRY_SIZE 0x10
@@ -316,7 +320,7 @@ elf64_hppa_object_p (bfd *abfd)
unsigned int flags;
i_ehdrp = elf_elfheader (abfd);
- if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
+ if (abfd->xvec == & hppa_elf64_linux_vec)
{
/* GCC on hppa-linux produces binaries with OSABI=GNU,
but the kernel produces corefiles with OSABI=SysV. */
@@ -1833,9 +1837,13 @@ elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
}
/* Force DT_FLAGS to always be set.
- Required by HPUX 11.00 patch PHSS_26559. */
- if (!add_dynamic_entry (DT_FLAGS, (info)->flags))
- return false;
+ Required by HPUX 11.00 patch PHSS_26559.
+ PR 30743: But do not set them for non-HPUX targets. */
+ if (output_bfd->xvec == & hppa_elf64_vec)
+ {
+ if (!add_dynamic_entry (DT_FLAGS, (info)->flags))
+ return false;
+ }
}
#undef add_dynamic_entry
reply other threads:[~2024-04-18 12:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240418122600.BB80C3849AF1@sourceware.org \
--to=nickc@sourceware.org \
--cc=binutils-cvs@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).