aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-03-18 10:51:31 +0000
committerNick Clifton <nickc@redhat.com>2010-03-18 10:51:31 +0000
commit17299ac7f6d12ac5286a490e43c0cdb75abc0f21 (patch)
tree667f92e679fd7f5b9963a6095504b82b15cb6d7a /ld
parent3a96536b1719be040188657f7cb1afb83ab914ca (diff)
downloadgdb-17299ac7f6d12ac5286a490e43c0cdb75abc0f21.zip
gdb-17299ac7f6d12ac5286a490e43c0cdb75abc0f21.tar.gz
gdb-17299ac7f6d12ac5286a490e43c0cdb75abc0f21.tar.bz2
* pe-dll.c (make_one): Make text section readonly.
(make_one): Add *ABS* symbol @feat.00 with value 1 to tag the jump stub on X86 as /SAFESEH compatible for native toolchains.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/pe-dll.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9633601..424b7e8 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-18 Doug Semler <dougsemler@gmail.com>
+
+ * pe-dll.c (make_one): Make text section readonly.
+ (make_one): Add *ABS* symbol @feat.00 with value 1 to tag
+ the jump stub on X86 as /SAFESEH compatible for
+ native toolchains.
+
2010-03-17 Alan Modra <amodra@gmail.com>
* ldlang.c (lang_size_sections_1): Remove "s" param. Set "s" from
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 2ddbdc1..ad5f82a 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -1,6 +1,6 @@
/* Routines to help build PEI-format DLLs (Win32 etc)
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009 Free Software Foundation, Inc.
+ 2008, 2009, 2010 Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com>
This file is part of the GNU Binutils.
@@ -2096,8 +2096,9 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = xmalloc (11 * sizeof (asymbol *));
- tx = quick_section (abfd, ".text", SEC_CODE|SEC_HAS_CONTENTS, 2);
+ symtab = xmalloc (12 * sizeof (asymbol *));
+
+ tx = quick_section (abfd, ".text", SEC_CODE | SEC_HAS_CONTENTS | SEC_READONLY, 2);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
@@ -2146,6 +2147,9 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
#ifdef pe_use_x86_64
quick_reloc (abfd, 2, BFD_RELOC_32_PCREL, 2);
#else
+ /* Mark this object as SAFESEH compatible. */
+ quick_symbol (abfd, "", "@feat.00", "", bfd_abs_section_ptr,
+ BSF_LOCAL, 1);
quick_reloc (abfd, 2, BFD_RELOC_32, 2);
#endif
break;