diff --git a/contrib/binutils/ld/emultempl/ppc64elf.em b/contrib/binutils/ld/emultempl/ppc64elf.em index 4f408a9fa29..aed5d3a36f1 100644 --- a/contrib/binutils/ld/emultempl/ppc64elf.em +++ b/contrib/binutils/ld/emultempl/ppc64elf.em @@ -60,6 +60,7 @@ ppc_create_output_section_statements (void) { extern const bfd_target bfd_elf64_powerpc_vec; extern const bfd_target bfd_elf64_powerpcle_vec; + asection *sect; if (link_info.hash->creator != &bfd_elf64_powerpc_vec && link_info.hash->creator != &bfd_elf64_powerpcle_vec) @@ -80,6 +81,8 @@ ppc_create_output_section_statements (void) return; } + if (bfd_get_section_by_name (stub_file->the_bfd, ".note.GNU-stack") == NULL) + sect = bfd_make_section (stub_file->the_bfd, ".note.GNU-stack"); ldlang_add_file (stub_file); ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info); }