Don't use dynamic_sec_flags on PLT .eh_frame section
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 25 May 2012 16:20:15 +0000 (16:20 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 25 May 2012 16:20:15 +0000 (16:20 +0000)
* elf32-i386.c (elf_i386_create_dynamic_sections): Don't use
dynamic_sec_flags to create PLT .eh_frame section.
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index 2165cd8c160235ca598e8b91853ebd349cb4790e..9834aab85c48dcc15eb93f4c462abf6ef829b694 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (elf_i386_create_dynamic_sections): Don't use
+       dynamic_sec_flags to create PLT .eh_frame section.
+       * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
+
 2012-05-25  Alan Modra  <amodra@gmail.com>
 
        PR ld/13909
index 7b33d77cc548b3c4cbdbb9a71c1f445e80e6e24d..6aa386d1752141e07cf82261aed3305acde8260f 100644 (file)
@@ -1018,12 +1018,11 @@ elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
       && htab->plt_eh_frame == NULL
       && htab->elf.splt != NULL)
     {
-      flagword flags = get_elf_backend_data (dynobj)->dynamic_sec_flags;
+      flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY
+                       | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+                       | SEC_LINKER_CREATED);
       htab->plt_eh_frame
-       = bfd_make_section_anyway_with_flags (dynobj, ".eh_frame",
-                                             (flags
-                                              | SEC_LINKER_CREATED
-                                              | SEC_READONLY));
+       = bfd_make_section_anyway_with_flags (dynobj, ".eh_frame", flags);
       if (htab->plt_eh_frame == NULL
          || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 2))
        return FALSE;
index abd8d60f51f290eba795891a10c8384fa9e43054..5614aa24fa680ac799f4dea99d80990bc2a62bcb 100644 (file)
@@ -982,12 +982,11 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
       && htab->plt_eh_frame == NULL
       && htab->elf.splt != NULL)
     {
-      flagword flags = get_elf_backend_data (dynobj)->dynamic_sec_flags;
+      flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY
+                       | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+                       | SEC_LINKER_CREATED);
       htab->plt_eh_frame
-       = bfd_make_section_anyway_with_flags (dynobj, ".eh_frame",
-                                             (flags
-                                              | SEC_LINKER_CREATED
-                                              | SEC_READONLY));
+       = bfd_make_section_anyway_with_flags (dynobj, ".eh_frame", flags);
       if (htab->plt_eh_frame == NULL
          || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3))
        return FALSE;