* elflink.h (elf_bfd_final_link): Check if dynobj is not NULL
authorJakub Jelinek <jakub@redhat.com>
Mon, 31 Dec 2001 11:49:10 +0000 (11:49 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 31 Dec 2001 11:49:10 +0000 (11:49 +0000)
before looking for .eh_frame_hdr section.
* elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If
.eh_frame_hdr section is being stripped from output, don't do
anything.

bfd/ChangeLog
bfd/elf-eh-frame.c
bfd/elflink.h

index a48ac88f6525201779a0110c368812cc753b4731..9b54028150dfe6ba00c86f41a326814f9866a587 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-31  Jakub Jelinek  <jakub@redhat.com>
+
+       * elflink.h (elf_bfd_final_link): Check if dynobj is not NULL
+       before looking for .eh_frame_hdr section.
+       * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If
+       .eh_frame_hdr section is being stripped from output, don't do
+       anything.
+
 2001-12-27  Tom Rix  <trix@redhat.com>
        
        * coff-rs6000.c (xcoff_generate_rtinit): Clean data_buffer alloc/free.
index d39e549369b240ea193846761bd8a7f834d2277f..cc653f7c81ed430de2ac5b1f9bc640b0957760f6 100644 (file)
@@ -1149,6 +1149,9 @@ _bfd_elf_write_section_eh_frame_hdr (abfd, sec)
              == ELF_INFO_TYPE_EH_FRAME_HDR);
   hdr_info = (struct eh_frame_hdr_info *)
             elf_section_data (sec)->sec_info;
+  if (hdr_info->strip)
+    return true;
+
   size = EH_FRAME_HDR_SIZE;
   if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count)
     size += 4 + hdr_info->fde_count * 8;
index 00872600f1b777df35c9e735785c07b32e7714af..9a3bfd3885b88c1151d2f9c10f6bf3c8d0bb70cf 100644 (file)
@@ -5670,7 +5670,7 @@ elf_bfd_final_link (abfd, info)
        goto error_return;
     }
 
-  if (info->eh_frame_hdr)
+  if (info->eh_frame_hdr && elf_hash_table (info)->dynobj)
     {
       o = bfd_get_section_by_name (elf_hash_table (info)->dynobj,
                                   ".eh_frame_hdr");