aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-04-18 13:24:42 +0100
committerNick Clifton <nickc@redhat.com>2024-04-18 13:24:42 +0100
commit31d5afc19d98869aa13c3197f55b8a208fd19da2 (patch)
tree0c2ac22f3f5ad5919b803be5db1add6812220aba /bfd
parent41d5ff24c6723b87ada11c1287f50cb87f7d89e2 (diff)
downloadbinutils-31d5afc19d98869aa13c3197f55b8a208fd19da2.zip
binutils-31d5afc19d98869aa13c3197f55b8a208fd19da2.tar.gz
binutils-31d5afc19d98869aa13c3197f55b8a208fd19da2.tar.bz2
HPPA64 linker: Do not force the generation of DT_FLAGS for Linux targets.
PR 30743
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf64-hppa.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 041ab29..2d08bf3 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