aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <siarheit@google.com>2020-01-03 11:21:00 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2020-01-04 12:07:31 +0000
commitb6a2c24277b5613a9c959f7b53e435280f60384e (patch)
tree35c6ec38cdc68b9c245c10b97f1bcf364b63a212
parentPR24233, Out of memory (diff)
downloadbinutils-gdb-gentoo/binutils-2.32.tar.gz
binutils-gdb-gentoo/binutils-2.32.tar.bz2
binutils-gdb-gentoo/binutils-2.32.zip
Fix ld/PR25316 for the ia64 target by refusing to support binary merging.gentoo/binutils-2.32-3gentoo/binutils-2.32
ld/PR25316 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail on binary inputs ld/PR25316. (is_ia64_elf): new helper to filter on ia64 objects. Cherry-picked from upstream's b26a3d5827edcb942b3af5b9. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--bfd/elfnn-ia64.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 24b948af23..886e7ff4e3 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -39,6 +39,10 @@
#define LOG_SECTION_ALIGN 2
#endif
+#define is_ia64_elf(bfd) \
+ (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
+ && elf_object_id (bfd) == IA64_ELF_DATA)
+
typedef struct bfd_hash_entry *(*new_hash_entry_func)
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
@@ -4736,6 +4740,7 @@ elfNN_ia64_set_private_flags (bfd *abfd, flagword flags)
/* Merge backend specific data from an object file to the output
object file when linking. */
+
static bfd_boolean
elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
@@ -4744,10 +4749,8 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
flagword in_flags;
bfd_boolean ok = TRUE;
- /* Don't even pretend to support mixed-format linking. */
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return FALSE;
+ if (!is_ia64_elf (ibfd) || !is_ia64_elf (obfd))
+ return TRUE;
in_flags = elf_elfheader (ibfd)->e_flags;
out_flags = elf_elfheader (obfd)->e_flags;