Date: Fri, 14 Jan 2011 11:28:34 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217395 - head/contrib/binutils/ld/emultempl Message-ID: <201101141128.p0EBSYiu086301@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Jan 14 11:28:34 2011 New Revision: 217395 URL: http://svn.freebsd.org/changeset/base/217395 Log: 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 Modified: head/contrib/binutils/ld/emultempl/ppc64elf.em Modified: head/contrib/binutils/ld/emultempl/ppc64elf.em ============================================================================== --- head/contrib/binutils/ld/emultempl/ppc64elf.em Fri Jan 14 11:25:11 2011 (r217394) +++ head/contrib/binutils/ld/emultempl/ppc64elf.em Fri Jan 14 11:28:34 2011 (r217395) @@ -60,6 +60,7 @@ ppc_create_output_section_statements (vo { 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 (vo 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101141128.p0EBSYiu086301>