summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-01-14 11:28:34 +0000
committerkib <kib@FreeBSD.org>2011-01-14 11:28:34 +0000
commit019965af3d88e9036cfdad4fc96823ae27bc890b (patch)
tree285e3727ac0fb78fd05dee0e02f96dc991728f13 /contrib/binutils/ld
parenta2a834c64db44ca8b4271b14d7ac850ca89e4a61 (diff)
downloadFreeBSD-src-019965af3d88e9036cfdad4fc96823ae27bc890b.zip
FreeBSD-src-019965af3d88e9036cfdad4fc96823ae27bc890b.tar.gz
On PowerPC64, linker emits a fake object into each linked object,
'linker stubs'. Add .note.GNU-stack for the stubs objects. Without this, final binary will have RWE mode for PT_GNU_STACK regardless of the actual requirements. Tested by: nwhitehorn Reviewed by: dim, nwhitehorn
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r--contrib/binutils/ld/emultempl/ppc64elf.em3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/binutils/ld/emultempl/ppc64elf.em b/contrib/binutils/ld/emultempl/ppc64elf.em
index 4f408a9..aed5d3a 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);
}
OpenPOWER on IntegriCloud