diff options
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/aarch64elf.em | 1 | ||||
-rw-r--r-- | ld/emultempl/aix.em | 1 | ||||
-rw-r--r-- | ld/emultempl/armcoff.em | 1 | ||||
-rw-r--r-- | ld/emultempl/armelf.em | 1 | ||||
-rw-r--r-- | ld/emultempl/beos.em | 1 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 3 | ||||
-rw-r--r-- | ld/emultempl/generic.em | 1 | ||||
-rw-r--r-- | ld/emultempl/gld960.em | 1 | ||||
-rw-r--r-- | ld/emultempl/gld960c.em | 1 | ||||
-rw-r--r-- | ld/emultempl/linux.em | 2 | ||||
-rw-r--r-- | ld/emultempl/lnk960.em | 1 | ||||
-rw-r--r-- | ld/emultempl/m68kcoff.em | 1 | ||||
-rw-r--r-- | ld/emultempl/mmix-elfnmmo.em | 10 | ||||
-rw-r--r-- | ld/emultempl/mmixelf.em | 2 | ||||
-rw-r--r-- | ld/emultempl/msp430.em | 1 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 1 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 1 | ||||
-rw-r--r-- | ld/emultempl/ppc32elf.em | 6 | ||||
-rw-r--r-- | ld/emultempl/scoreelf.em | 1 | ||||
-rw-r--r-- | ld/emultempl/sunos.em | 1 | ||||
-rw-r--r-- | ld/emultempl/ticoff.em | 1 | ||||
-rw-r--r-- | ld/emultempl/vanilla.em | 1 |
22 files changed, 35 insertions, 5 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em index 3007e4d..f1a3a48 100644 --- a/ld/emultempl/aarch64elf.em +++ b/ld/emultempl/aarch64elf.em @@ -43,6 +43,7 @@ gld${EMULATION_NAME}_before_parse (void) input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; link_info.relro = DEFAULT_LD_Z_RELRO; } diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 480bbbc..4965ad2 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -1539,6 +1539,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { hll_default, after_parse_default, gld${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, gld${EMULATION_NAME}_set_output_arch, gld${EMULATION_NAME}_choose_target, diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index de2847b..bccf353 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -261,6 +261,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, after_parse_default, gld${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 34ff993..8fb92e4 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -58,6 +58,7 @@ gld${EMULATION_NAME}_before_parse (void) input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; link_info.relro = DEFAULT_LD_Z_RELRO; } diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 3128e20..8b7d5a5 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -764,6 +764,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, after_parse_default, gld_${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 8737376..ff4d565 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -104,7 +104,7 @@ gld${EMULATION_NAME}_before_parse (void) config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; `if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`; - link_info.check_relocs_after_open_input = `if test "x${CHECK_RELOCS_AFTER_OPEN_INPUT}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; link_info.relro = DEFAULT_LD_Z_RELRO; } @@ -2813,6 +2813,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_HLL-hll_default}, ${LDEMUL_AFTER_PARSE-gld${EMULATION_NAME}_after_parse}, ${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open}, + ${LDEMUL_AFTER_CHECK_RELOCS-after_check_relocs_default}, ${LDEMUL_AFTER_ALLOCATION-gld${EMULATION_NAME}_after_allocation}, ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default}, ${LDEMUL_CHOOSE_TARGET-ldemul_default_target}, diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index 55a19a8..9a54ba2 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -136,6 +136,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_HLL-hll_default}, ${LDEMUL_AFTER_PARSE-after_parse_default}, ${LDEMUL_AFTER_OPEN-after_open_default}, + ${LDEMUL_AFTER_CHECK_RELOCS-after_check_relocs_default}, ${LDEMUL_AFTER_ALLOCATION-after_allocation_default}, ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default}, ${LDEMUL_CHOOSE_TARGET-ldemul_default_target}, diff --git a/ld/emultempl/gld960.em b/ld/emultempl/gld960.em index 683bb81..9489462 100644 --- a/ld/emultempl/gld960.em +++ b/ld/emultempl/gld960.em @@ -129,6 +129,7 @@ struct ld_emulation_xfer_struct ld_gld960_emulation = hll_default, after_parse_default, after_open_default, + after_check_relocs_default, after_allocation_default, gld960_set_output_arch, gld960_choose_target, diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em index 7bbb83a..1b4d09a 100644 --- a/ld/emultempl/gld960c.em +++ b/ld/emultempl/gld960c.em @@ -142,6 +142,7 @@ struct ld_emulation_xfer_struct ld_gld960coff_emulation = hll_default, after_parse_default, after_open_default, + after_check_relocs_default, after_allocation_default, gld960_set_output_arch, gld960_choose_target, diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index b79537d..0befb26 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -50,6 +50,7 @@ gld${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); input_flags.dynamic = TRUE; config.has_shared = TRUE; + link_info.check_relocs_after_open_input = TRUE; link_info.relro = DEFAULT_LD_Z_RELRO; } @@ -187,6 +188,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, after_parse_default, after_open_default, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index b30acb6..35fbae3 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -323,6 +323,7 @@ struct ld_emulation_xfer_struct ld_lnk960_emulation = lnk960_hll, lnk960_after_parse, after_open_default, + after_check_relocs_default, lnk960_after_allocation, lnk960_set_output_arch, lnk960_choose_target, diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index 359f0e0..424520e 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -220,6 +220,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = syslib_default, hll_default, after_parse_default, + after_check_relocs_default, gld${EMULATION_NAME}_after_open, gld${EMULATION_NAME}_after_allocation, set_output_arch_default, diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em index d703eac..39f532b 100644 --- a/ld/emultempl/mmix-elfnmmo.em +++ b/ld/emultempl/mmix-elfnmmo.em @@ -25,6 +25,15 @@ fragment <<EOF #include "elf/mmix.h" +static void gld${EMULATION_NAME}_before_parse (void); + +static void +mmix_before_parse (void) +{ + link_info.check_relocs_after_open_input = TRUE; + gld${EMULATION_NAME}_before_parse (); +} + /* Set up handling of linker-allocated global registers. */ static void @@ -111,5 +120,6 @@ mmix_after_allocation (void) } EOF +LDEMUL_BEFORE_PARSE=mmix_before_parse LDEMUL_AFTER_ALLOCATION=mmix_after_allocation LDEMUL_BEFORE_ALLOCATION=mmix_before_allocation diff --git a/ld/emultempl/mmixelf.em b/ld/emultempl/mmixelf.em index 8123d40..d9a2ba1 100644 --- a/ld/emultempl/mmixelf.em +++ b/ld/emultempl/mmixelf.em @@ -29,7 +29,7 @@ fragment <<EOF static void elfmmix_before_parse (void) { - gld${EMULATION_NAME}_before_parse (); + mmix_before_parse (); /* Make sure we don't create a demand-paged executable. Unfortunately this isn't changeable with a command-line option. It makes no diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em index 0792e3c..65e6fb2 100644 --- a/ld/emultempl/msp430.em +++ b/ld/emultempl/msp430.em @@ -838,6 +838,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_HLL-hll_default}, ${LDEMUL_AFTER_PARSE-after_parse_default}, msp430_elf_after_open, + after_check_relocs_default, msp430_elf_after_allocation, ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default}, ${LDEMUL_CHOOSE_TARGET-ldemul_default_target}, diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 0693483..039602a 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -2474,6 +2474,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, gld_${EMULATION_NAME}_after_parse, gld_${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 1446e04..f76738c 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -2247,6 +2247,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, gld_${EMULATION_NAME}_after_parse, gld_${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index 374459c..b1ea04d 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -57,7 +57,7 @@ EOF if test -z "$VXWORKS_BASE_EM_FILE" ; then fragment <<EOF static void -ppc_after_open (void) +ppc_after_check_relocs (void) { if (is_ppc_elf (link_info.output_bfd)) { @@ -108,7 +108,7 @@ ppc_after_open (void) } } - gld${EMULATION_NAME}_after_open (); + after_check_relocs_default (); } EOF @@ -355,7 +355,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}' # LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_after_open_output if test -z "$VXWORKS_BASE_EM_FILE" ; then - LDEMUL_AFTER_OPEN=ppc_after_open + LDEMUL_AFTER_CHECK_RELOCS=ppc_after_check_relocs fi LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation LDEMUL_FINISH=ppc_finish diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em index 9560ff2..367f758 100644 --- a/ld/emultempl/scoreelf.em +++ b/ld/emultempl/scoreelf.em @@ -39,6 +39,7 @@ gld${EMULATION_NAME}_before_parse (void) input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; link_info.relro = DEFAULT_LD_Z_RELRO; } diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index 44e6e51..51e46dd 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -1016,6 +1016,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, after_parse_default, gld${EMULATION_NAME}_after_open, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index d394e12..b2552db 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -161,6 +161,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = hll_default, after_parse_default, after_open_default, + after_check_relocs_default, after_allocation_default, set_output_arch_default, ldemul_default_target, diff --git a/ld/emultempl/vanilla.em b/ld/emultempl/vanilla.em index 3d8dc44..83837b9 100644 --- a/ld/emultempl/vanilla.em +++ b/ld/emultempl/vanilla.em @@ -62,6 +62,7 @@ struct ld_emulation_xfer_struct ld_vanilla_emulation = hll_default, after_parse_default, after_open_default, + after_check_relocs_default, after_allocation_default, vanilla_set_output_arch, ldemul_default_target, |