ubsan: i386-dis.c
[deliverable/binutils-gdb.git] / ld / ldelf.c
index 8f2167e8895ef3bdd5029ff2f5c247ad868c3617..75c6c015aee8002e6f744adc5b9b261ad7163147 100644 (file)
@@ -262,6 +262,8 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
       return FALSE;
     }
 
+  track_dependency_files (name);
+
   /* Linker needs to decompress sections.  */
   abfd->flags |= BFD_DECOMPRESS;
 
@@ -1041,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 (elf_tdata (abfd) != NULL
+      if (!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 ?  */
          && elf_tdata (abfd)->elf_header->e_type == ET_EXEC)
@@ -1065,7 +1068,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
        }
       return;
     }
-  
+
   if (!link_info.traditional_format)
     {
       bfd *elfbfd = NULL;
@@ -1076,13 +1079,6 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
        {
          int type = 0;
 
-         if (bfd_link_executable (& link_info)
-             && elf_tdata (abfd)->elf_header->e_type == ET_EXEC)
-           {
-             einfo (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
-                    abfd);
-           }
-
          if (bfd_input_just_syms (abfd))
            continue;
 
@@ -2194,6 +2190,7 @@ ldelf_before_place_orphans (void)
              if (discarded_section (linked_to_sec))
                {
                  isec->output_section = bfd_abs_section_ptr;
+                 isec->flags |= SEC_EXCLUDE;
                  break;
                }
          }
This page took 0.025336 seconds and 4 git commands to generate.