Sourceware Bugzilla – Attachment 11152 Details for
Bug 19011
Issues with ld on mingw-w64 and bad defaults
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Don't strip reloc sections when building with dynamicbase
0001-ld-pe-Don-t-set-IMAGE_FILE_RELOCS_STRIPPED-when-dyna.patch (text/plain), 3.29 KB, created by
hugo@beauzee.fr
on 2018-07-25 09:39:19 UTC
(
hide
)
Description:
Don't strip reloc sections when building with dynamicbase
Filename:
MIME Type:
Creator:
hugo@beauzee.fr
Created:
2018-07-25 09:39:19 UTC
Size:
3.29 KB
patch
obsolete
>From 0fbc0ab400954c060fece830ca582f41dd6882e7 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr> >Date: Wed, 25 Jul 2018 11:35:44 +0200 >Subject: [PATCH] ld: pe: Don't set IMAGE_FILE_RELOCS_STRIPPED when > --dynamicbase is passed > >--- > ld/ChangeLog | 5 +++++ > ld/emultempl/pe.em | 3 +++ > ld/emultempl/pep.em | 3 +++ > 3 files changed, 11 insertions(+) > >diff --git a/ld/ChangeLog b/ld/ChangeLog >index 0b3058b20e..85d57ab44e 100644 >--- a/ld/ChangeLog >+++ b/ld/ChangeLog >@@ -1,3 +1,8 @@ >+2018-07-25 Hugo Beauzée-Luyssen <hugo@beauzee.fr> >+ * emultempl/pe.em: Ensure IMAGE_FILE_RELOCS_STRIPPED is not >+ set when building with -Wl,--dynamicbase >+ * emultempl/pep.em: Likewise >+ > 2018-07-25 Alan Modra <amodra@gmail.com> > > * testsuite/ld-powerpc/big.s: New file. >diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em >index 463b85481d..7177be2288 100644 >--- a/ld/emultempl/pe.em >+++ b/ld/emultempl/pe.em >@@ -132,6 +132,7 @@ static lang_assignment_statement_type *image_base_statement = 0; > static unsigned short pe_dll_characteristics = 0; > static bfd_boolean insert_timestamp = TRUE; > static const char *emit_build_id; >+static bfd_boolean force_relocs = FALSE; > > #ifdef DLL_SUPPORT > static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable. */ >@@ -854,6 +855,7 @@ gld${EMULATION_NAME}_handle_option (int optc) > break; > /* Get DLLCharacteristics bits */ > case OPTION_DYNAMIC_BASE: >+ force_relocs = TRUE; > pe_dll_characteristics |= IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE; > break; > case OPTION_FORCE_INTEGRITY: >@@ -1369,6 +1371,7 @@ gld_${EMULATION_NAME}_after_open (void) > pe_data (link_info.output_bfd)->dll = init[DLLOFF].value; > pe_data (link_info.output_bfd)->real_flags |= real_flags; > pe_data (link_info.output_bfd)->insert_timestamp = insert_timestamp; >+ pe_data(link_info.output_bfd)->dont_strip_reloc = force_relocs; > > /* At this point we must decide whether to use long section names > in the output or not. If the user hasn't explicitly specified >diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em >index 1a7394ea46..d1b7a63dec 100644 >--- a/ld/emultempl/pep.em >+++ b/ld/emultempl/pep.em >@@ -149,6 +149,7 @@ static lang_assignment_statement_type *image_base_statement = 0; > static unsigned short pe_dll_characteristics = 0; > static bfd_boolean insert_timestamp = TRUE; > static const char *emit_build_id; >+static bfd_boolean force_relocs = FALSE; > > #ifdef DLL_SUPPORT > static int pep_enable_stdcall_fixup = 1; /* 0=disable 1=enable (default). */ >@@ -800,6 +801,7 @@ gld${EMULATION_NAME}_handle_option (int optc) > pe_dll_characteristics |= IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA; > break; > case OPTION_DYNAMIC_BASE: >+ force_relocs = TRUE; > pe_dll_characteristics |= IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE; > break; > case OPTION_FORCE_INTEGRITY: >@@ -1357,6 +1359,7 @@ gld_${EMULATION_NAME}_after_open (void) > pe_data (link_info.output_bfd)->dll = init[DLLOFF].value; > pe_data (link_info.output_bfd)->real_flags |= real_flags; > pe_data (link_info.output_bfd)->insert_timestamp = insert_timestamp; >+ pe_data(link_info.output_bfd)->dont_strip_reloc = force_relocs; > > /* At this point we must decide whether to use long section names > in the output or not. If the user hasn't explicitly specified >-- >2.18.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19011
: 11152 |
12800
|
12801
|
12802
|
12804