diff options
author | midipix <writeonce@midipix.org> | 2019-08-16 03:38:17 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-08-16 03:38:17 -0400 |
commit | 0115fa98d2033f0a7d26f81fe9e7f2bba91aa729 (patch) | |
tree | 4c3e126503ffee7fa9356a600d59849bf893efb3 | |
parent | a2229cd0a1c6557417a406dc157087c416d8461d (diff) | |
download | chainport-0115fa98d2033f0a7d26f81fe9e7f2bba91aa729.tar.bz2 chainport-0115fa98d2033f0a7d26f81fe9e7f2bba91aa729.tar.xz |
binutils-2.24.51: further refactor pemdso.h, pe.em, and pep.em.
-rw-r--r-- | binutils-2.24.51.midipix.patch | 91 |
1 files changed, 47 insertions, 44 deletions
diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch index 70a4ff0..0e076a6 100644 --- a/binutils-2.24.51.midipix.patch +++ b/binutils-2.24.51.midipix.patch @@ -2,8 +2,8 @@ diff -ru --new-file a/bfd/pemdso.h b/bfd/pemdso.h --- a/bfd/pemdso.h 1969-12-31 19:00:00.000000000 -0500 +++ b/bfd/pemdso.h 2019-08-15 07:00:00.000000000 -0400 @@ -0,0 +1,11 @@ -+#ifndef MIDIPIX_H -+#define MIDIPIX_H ++#ifndef PEMDSO_H ++#define PEMDSO_H + +#include <perk/perk.h> +#include <mdso/mdso.h> @@ -43,16 +43,24 @@ diff -ru --new-file a/bfd/pemdso.h b/bfd/pemdso.h +#include "pemdso.h" +EOF +esac +diff --ru --new-file a/ld/sysdep.h b/ld/sysdep.h +--- a/ld/sysdep.h 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/sysdep.h 2019-08-16 03:08:47.771929753 -0400 +@@ -26,6 +26,7 @@ + #endif + + #include "config.h" ++#include "peimplib.h" + + #include <stdio.h> + #include <sys/types.h> diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em --- a/ld/emultempl/pe.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pe.em 2017-10-14 20:05:15.268012525 -0400 -@@ -35,6 +35,18 @@ - only determine if the subsystem is console or windows in order to select - the correct entry point by default. */ ++++ b/ld/emultempl/pe.em 2019-08-16 03:27:04.540631764 -0400 +@@ -69,6 +69,14 @@ fragment <<EOF + #include "ldbuildid.h" + #include "coff/internal.h" -+ -+#include "peimplib.h" -+ +#ifndef PE_IMPLIB_SUFFIX +#define PE_IMPLIB_SUFFIX ".dll.a" +#endif @@ -61,11 +69,10 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em +#define PE_DSO_SUFFIX ".dll" +#endif + -+ - #define TARGET_IS_${EMULATION_NAME} - - /* Do this before including bfd.h, so we prototype the right functions. */ -@@ -132,13 +144,15 @@ + /* FIXME: See bfd/peXXigen.c for why we include an architecture specific + header in generic PE code. */ + #include "coff/i386.h" +@@ -132,13 +140,15 @@ static int support_old_code = 0; static char * thumb_entry_symbol = NULL; static lang_assignment_statement_type *image_base_statement = 0; static unsigned short pe_dll_characteristics = 0; @@ -82,7 +89,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em static int pe_enable_auto_image_base = 0; static unsigned long pe_auto_image_base = 0x61500000; static char *pe_dll_search_prefix = NULL; -@@ -229,7 +243,9 @@ +@@ -229,7 +239,9 @@ fragment <<EOF #define OPTION_ENABLE_STDCALL_FIXUP (OPTION_STDCALL_ALIASES + 1) #define OPTION_DISABLE_STDCALL_FIXUP (OPTION_ENABLE_STDCALL_FIXUP + 1) #define OPTION_IMPLIB_FILENAME (OPTION_DISABLE_STDCALL_FIXUP + 1) @@ -93,7 +100,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em #define OPTION_WARN_DUPLICATE_EXPORTS (OPTION_THUMB_ENTRY + 1) #define OPTION_IMP_COMPAT (OPTION_WARN_DUPLICATE_EXPORTS + 1) #define OPTION_ENABLE_AUTO_IMAGE_BASE (OPTION_IMP_COMPAT + 1) -@@ -324,6 +340,8 @@ +@@ -324,6 +336,8 @@ gld${EMULATION_NAME}_add_options {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP}, {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP}, {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME}, @@ -102,7 +109,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS}, /* getopt() allows abbreviations, so we do this to stop it from treating -c as an abbreviation for these --compat-implib. */ -@@ -471,8 +489,8 @@ +@@ -471,8 +485,8 @@ gld_${EMULATION_NAME}_list_options (FILE *file) specifically set with --image-base\n")); fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n")); fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without\n\ @@ -113,7 +120,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ __imp_sym for DATA references\n")); fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); -@@ -808,6 +826,12 @@ +@@ -808,6 +822,12 @@ gld${EMULATION_NAME}_handle_option (int optc) case OPTION_IMPLIB_FILENAME: pe_implib_filename = xstrdup (optarg); break; @@ -126,7 +133,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em case OPTION_WARN_DUPLICATE_EXPORTS: pe_dll_warn_dup_exports = 1; break; -@@ -1698,7 +1722,7 @@ +@@ -1698,7 +1718,7 @@ gld_${EMULATION_NAME}_after_open (void) extension, and use that for the remainder of the comparisons. */ pnt = strrchr (is3->the_bfd->filename, '.'); @@ -135,7 +142,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em break; } -@@ -1733,7 +1757,7 @@ +@@ -1733,7 +1753,7 @@ gld_${EMULATION_NAME}_after_open (void) then leave the filename alone. */ pnt = strrchr (is->the_bfd->filename, '.'); @@ -144,7 +151,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em { int idata2 = 0, reloc_count=0; asection *sec; -@@ -2063,8 +2087,14 @@ +@@ -2063,8 +2083,14 @@ gld_${EMULATION_NAME}_finish (void) ) { pe_dll_fill_sections (link_info.output_bfd, &link_info); @@ -159,7 +166,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em } #if defined(TARGET_IS_shpe) /* ARM doesn't need relocs. */ -@@ -2298,10 +2328,14 @@ +@@ -2298,10 +2324,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive } libname_fmt [] = { @@ -176,7 +183,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ -@@ -2310,10 +2344,10 @@ +@@ -2310,10 +2340,10 @@ gld_${EMULATION_NAME}_open_dynamic_archive { "%s.lib", FALSE }, #ifdef DLL_SUPPORT /* Try "<prefix>foo.dll" (preferred dll name, if specified). */ @@ -191,14 +198,11 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em /* Note: If adding more formats to this table, make sure to check to diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em --- a/ld/emultempl/pep.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pep.em 2017-10-14 19:17:10.840545945 -0400 -@@ -42,6 +42,18 @@ - /* For WINDOWS_XP64 and higher */ - /* Based on pe.em, but modified for 64 bit support. */ ++++ b/ld/emultempl/pep.em 2019-08-16 03:27:04.540631764 -0400 +@@ -67,6 +67,14 @@ fragment <<EOF + #include "ldbuildid.h" + #include "coff/internal.h" -+ -+#include "peimplib.h" -+ +#ifndef PE_IMPLIB_SUFFIX +#define PE_IMPLIB_SUFFIX ".dll.a" +#endif @@ -207,11 +211,10 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em +#define PE_DSO_SUFFIX ".dll" +#endif + -+ - #define TARGET_IS_${EMULATION_NAME} - - #define COFF_IMAGE_WITH_PE -@@ -147,13 +159,15 @@ + /* FIXME: See bfd/peXXigen.c for why we include an architecture specific + header in generic PE code. */ + #include "coff/x86_64.h" +@@ -147,13 +155,15 @@ static flagword real_flags = IMAGE_FILE_LARGE_ADDRESS_AWARE; static int support_old_code = 0; static lang_assignment_statement_type *image_base_statement = 0; static unsigned short pe_dll_characteristics = 0; @@ -228,7 +231,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em static int pep_enable_auto_image_base = 0; static char * pep_dll_search_prefix = NULL; #endif -@@ -218,6 +232,8 @@ +@@ -218,6 +228,8 @@ enum options OPTION_ENABLE_STDCALL_FIXUP, OPTION_DISABLE_STDCALL_FIXUP, OPTION_IMPLIB_FILENAME, @@ -237,7 +240,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em OPTION_WARN_DUPLICATE_EXPORTS, OPTION_IMP_COMPAT, OPTION_ENABLE_AUTO_IMAGE_BASE, -@@ -296,6 +312,8 @@ +@@ -296,6 +308,8 @@ gld${EMULATION_NAME}_add_options {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP}, {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP}, {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME}, @@ -246,7 +249,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS}, /* getopt() allows abbreviations, so we do this to stop it from treating -c as an abbreviation for these --compat-implib. */ -@@ -434,8 +452,8 @@ +@@ -434,8 +448,8 @@ gld_${EMULATION_NAME}_list_options (FILE *file) unless user specifies one\n")); fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n")); fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without\n\ @@ -257,7 +260,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ __imp_sym for DATA references\n")); fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); -@@ -760,6 +778,12 @@ +@@ -760,6 +774,12 @@ gld${EMULATION_NAME}_handle_option (int optc) case OPTION_IMPLIB_FILENAME: pep_implib_filename = xstrdup (optarg); break; @@ -270,7 +273,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em case OPTION_WARN_DUPLICATE_EXPORTS: pep_dll_warn_dup_exports = 1; break; -@@ -1635,7 +1659,7 @@ +@@ -1635,7 +1655,7 @@ gld_${EMULATION_NAME}_after_open (void) extension, and use that for the remainder of the comparisons. */ pnt = strrchr (is3->the_bfd->filename, '.'); @@ -279,7 +282,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em break; } -@@ -1670,7 +1694,7 @@ +@@ -1670,7 +1690,7 @@ gld_${EMULATION_NAME}_after_open (void) then leave the filename alone. */ pnt = strrchr (is->the_bfd->filename, '.'); @@ -288,7 +291,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em { int idata2 = 0, reloc_count=0; asection *sec; -@@ -1834,8 +1858,14 @@ +@@ -1834,8 +1854,14 @@ gld_${EMULATION_NAME}_finish (void) || (!link_info.relocatable && pep_def_file->num_exports != 0)) { pep_dll_fill_sections (link_info.output_bfd, &link_info); @@ -303,7 +306,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em } if (pep_out_def_filename) -@@ -2062,10 +2092,14 @@ +@@ -2062,10 +2088,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive } libname_fmt [] = { @@ -320,7 +323,7 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ -@@ -2074,10 +2108,10 @@ +@@ -2074,10 +2104,10 @@ gld_${EMULATION_NAME}_open_dynamic_archive { "%s.lib", FALSE }, #ifdef DLL_SUPPORT /* Try "<prefix>foo.dll" (preferred dll name, if specified). */ |