]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/ldelf.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / ldelf.c
index 75c6c015aee8002e6f744adc5b9b261ad7163147..f7407ab55a7e24f26a6bfb413e325aba5b278d2c 100644 (file)
@@ -1,5 +1,5 @@
 /* ELF emulation code for targets using elf.em.
-   Copyright (C) 1991-2020 Free Software Foundation, Inc.
+   Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -1043,7 +1043,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
   /* Do not allow executable files to be used as inputs to the link.  */
   for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
     {
-      if (!bfd_input_just_syms (abfd)
+      if (abfd->xvec->flavour == bfd_target_elf_flavour
+         && !bfd_input_just_syms (abfd)
          && elf_tdata (abfd) != NULL
          && elf_tdata (abfd)->elf_header != NULL
          /* FIXME: Maybe check for other non-supportable types as well ?  */
@@ -1589,6 +1590,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
                      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
                      sizeof ehdr_start_save_u);
              ehdr_start->type = bfd_link_hash_defined;
+             /* It will be converted to section-relative later.  */
+             ehdr_start->rel_from_abs = 1;
              ehdr_start->u.def.section = bfd_abs_section_ptr;
              ehdr_start->u.def.value = 0;
            }