aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-08-04 06:22:14 +0000
committerAlan Modra <amodra@gmail.com>2005-08-04 06:22:14 +0000
commit046183de0ebe379c1ec11188000bb6e0f64a9e0e (patch)
tree3eb7034b61e33a4305933aeca12fda76ab10f662 /ld
parentfa498e09475dc0fc2d6e12f440f3f38df470100a (diff)
downloadgdb-046183de0ebe379c1ec11188000bb6e0f64a9e0e.zip
gdb-046183de0ebe379c1ec11188000bb6e0f64a9e0e.tar.gz
gdb-046183de0ebe379c1ec11188000bb6e0f64a9e0e.tar.bz2
bfd/
* elf32-ppc.c (struct elf_linker_section): Replace sym_val field with sym. (ppc_elf_relocate_section): Adjust for above. (create_sdata_sym): New function. (ppc_elf_create_linker_section): Call it. (ppc_elf_check_relocs): Correct has_sda_refs and non_got_refs. Create sdata syms for all SDA relocs. (ppc_elf_adjust_dynamic_symbol): Don't special case _SDA_BASE_ and _SDA2_BASE_. (ppc_elf_set_sdata_syms): Delete. * elflink.c (bfd_elf_size_dynamic_sections): Don't create DT_INIT and DT_FINI tags unless associated section has input. (bfd_elf_set_symbol, _bfd_elf_provide_symbol): Delete. (_bfd_elf_provide_section_bound_symbols): Delete. * bfd-in.h (_bfd_elf_provide_symbol): Delete. (_bfd_elf_provide_section_bound_symbols): Delete. * bfd-in2.h: Regenerate. ld/ * ldemul.c (ldemul_do_assignments, do_assignments_default): Delete. * ldemul.h (ldemul_do_assignments, do_assignments_default): Delete. (struct ld_emulation_xfer_struct): Remove do_assignments field. * ldlang.c (lang_do_assignments): Don't call ldemul_do_assignments. * emulparams/elf32ppc.sh (SDATA_START_SYMBOLS): New. (SDATA2_START_SYMBOLS, SBSS_START_SYMBOLS, SBSS_END_SYMBOLS): New. * emultempl/aix.em (ld_*_emulation): Delete do_assignments init. * emultempl/armcoff.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/generic.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/elf32.em: Likewise. (gld*_provide_bound_symbols): Delete. (gld*_provide_init_fini_syms): Delete. (gld*_before_allocation): Don't call ldemul_do_assignments. * emultempl/ppc32elf.em (ppc_do_assignments): Delete. (LDEMUL_DO_ASSIGNMENTS): Delete. * scripttempl/elf.sc: Provide init/fini syms. Add SBSS_START_SYMBOLS, SBSS_END_SYMBOLS, SDATA2_START_SYMBOLS.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog30
-rw-r--r--ld/emulparams/elf32ppc.sh11
-rw-r--r--ld/emultempl/aix.em1
-rw-r--r--ld/emultempl/armcoff.em1
-rw-r--r--ld/emultempl/beos.em1
-rw-r--r--ld/emultempl/elf32.em45
-rw-r--r--ld/emultempl/generic.em1
-rw-r--r--ld/emultempl/gld960.em1
-rw-r--r--ld/emultempl/gld960c.em1
-rw-r--r--ld/emultempl/linux.em1
-rw-r--r--ld/emultempl/lnk960.em1
-rw-r--r--ld/emultempl/m68kcoff.em1
-rw-r--r--ld/emultempl/pe.em1
-rw-r--r--ld/emultempl/ppc32elf.em18
-rw-r--r--ld/emultempl/sunos.em1
-rw-r--r--ld/emultempl/ticoff.em1
-rw-r--r--ld/emultempl/vanilla.em1
-rw-r--r--ld/ldemul.c11
-rw-r--r--ld/ldemul.h7
-rw-r--r--ld/ldlang.c5
-rw-r--r--ld/scripttempl/elf.sc30
21 files changed, 68 insertions, 102 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index de94006..907208f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,35 @@
2005-08-04 Alan Modra <amodra@bigpond.net.au>
+ * ldemul.c (ldemul_do_assignments, do_assignments_default): Delete.
+ * ldemul.h (ldemul_do_assignments, do_assignments_default): Delete.
+ (struct ld_emulation_xfer_struct): Remove do_assignments field.
+ * ldlang.c (lang_do_assignments): Don't call ldemul_do_assignments.
+ * emulparams/elf32ppc.sh (SDATA_START_SYMBOLS): New.
+ (SDATA2_START_SYMBOLS, SBSS_START_SYMBOLS, SBSS_END_SYMBOLS): New.
+ * emultempl/aix.em (ld_*_emulation): Delete do_assignments init.
+ * emultempl/armcoff.em: Likewise.
+ * emultempl/beos.em: Likewise.
+ * emultempl/generic.em: Likewise.
+ * emultempl/gld960.em: Likewise.
+ * emultempl/gld960c.em: Likewise.
+ * emultempl/linux.em: Likewise.
+ * emultempl/lnk960.em: Likewise.
+ * emultempl/m68kcoff.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+ * emultempl/ticoff.em: Likewise.
+ * emultempl/vanilla.em: Likewise.
+ * emultempl/elf32.em: Likewise.
+ (gld*_provide_bound_symbols): Delete.
+ (gld*_provide_init_fini_syms): Delete.
+ (gld*_before_allocation): Don't call ldemul_do_assignments.
+ * emultempl/ppc32elf.em (ppc_do_assignments): Delete.
+ (LDEMUL_DO_ASSIGNMENTS): Delete.
+ * scripttempl/elf.sc: Provide init/fini syms. Add SBSS_START_SYMBOLS,
+ SBSS_END_SYMBOLS, SDATA2_START_SYMBOLS.
+
+2005-08-04 Alan Modra <amodra@bigpond.net.au>
+
* Makefile.am (eelf32m32c.c): Fix dependencies.
* Makefile.in: Regenerate.
diff --git a/ld/emulparams/elf32ppc.sh b/ld/emulparams/elf32ppc.sh
index e5b2252..ad6876d 100644
--- a/ld/emulparams/elf32ppc.sh
+++ b/ld/emulparams/elf32ppc.sh
@@ -23,6 +23,17 @@ PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }"
GOTPLT="${PLT}"
OTHER_TEXT_SECTIONS="*(.glink)"
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
+if test -z "${CREATE_SHLIB}"; then
+ SDATA_START_SYMBOLS="PROVIDE (_SDA_BASE_ = 32768);"
+ SDATA2_START_SYMBOLS="PROVIDE (_SDA2_BASE_ = 32768);"
+ SBSS_START_SYMBOLS="PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);"
+ SBSS_END_SYMBOLS="PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);"
+else
+ unset SDATA_START_SYMBOLS
+ unset SDATA2_START_SYMBOLS
+ unset SBSS_START_SYMBOLS
+ unset SBSS_END_SYMBOLS
+fi
OTHER_END_SYMBOLS="__end = .;"
OTHER_RELRO_SECTIONS="
.fixup ${RELOCATING-0} : { *(.fixup) }
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 8763155..d525edd 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -1339,7 +1339,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
gld${EMULATION_NAME}_set_output_arch,
gld${EMULATION_NAME}_choose_target,
gld${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em
index acf117c..d5fd67d 100644
--- a/ld/emultempl/armcoff.em
+++ b/ld/emultempl/armcoff.em
@@ -261,7 +261,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
gld${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index e07677b..0b06bc7 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -766,7 +766,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
gld_${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld_${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index e43c8c5..2764a59 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -57,7 +57,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
/* Declare functions used by various EXTRA_EM_FILEs. */
static void gld${EMULATION_NAME}_before_parse (void);
static void gld${EMULATION_NAME}_after_open (void);
-static void gld${EMULATION_NAME}_provide_init_fini_syms (void);
static void gld${EMULATION_NAME}_before_allocation (void);
static bfd_boolean gld${EMULATION_NAME}_place_orphan
(lang_input_statement_type *file, asection *s);
@@ -1040,47 +1039,6 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation;
fi
cat >>e${EMULATION_NAME}.c <<EOF
-static void
-gld${EMULATION_NAME}_provide_bound_symbols (const char *sec,
- const char *start,
- const char *end)
-{
- asection *s = bfd_get_section_by_name (output_bfd, sec);
- _bfd_elf_provide_section_bound_symbols (&link_info, s, start, end);
-}
-
-/* If not building a shared library, provide
-
- __preinit_array_start
- __preinit_array_end
- __init_array_start
- __init_array_end
- __fini_array_start
- __fini_array_end
-
- They are set here rather than via PROVIDE in the linker
- script, because using PROVIDE inside an output section
- statement results in unnecessary output sections. Using
- PROVIDE outside an output section statement runs the risk of
- section alignment affecting where the section starts. */
-
-static void
-gld${EMULATION_NAME}_provide_init_fini_syms (void)
-{
- if (!link_info.relocatable && link_info.executable)
- {
- gld${EMULATION_NAME}_provide_bound_symbols (".preinit_array",
- "__preinit_array_start",
- "__preinit_array_end");
- gld${EMULATION_NAME}_provide_bound_symbols (".init_array",
- "__init_array_start",
- "__init_array_end");
- gld${EMULATION_NAME}_provide_bound_symbols (".fini_array",
- "__fini_array_start",
- "__fini_array_end");
- }
-}
-
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1098,8 +1056,6 @@ gld${EMULATION_NAME}_before_allocation (void)
referred to by dynamic objects. */
lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);
- ldemul_do_assignments ();
-
/* Let the ELF backend work out the sizes of any sections required
by dynamic linking. */
rpath = command_line.rpath;
@@ -1881,7 +1837,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default},
${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
${LDEMUL_BEFORE_ALLOCATION-gld${EMULATION_NAME}_before_allocation},
- ${LDEMUL_DO_ASSIGNMENTS-gld${EMULATION_NAME}_provide_init_fini_syms},
${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em
index f7153b6..985cdf8 100644
--- a/ld/emultempl/generic.em
+++ b/ld/emultempl/generic.em
@@ -128,7 +128,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default},
${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
${LDEMUL_BEFORE_ALLOCATION-before_allocation_default},
- ${LDEMUL_DO_ASSIGNMENTS-do_assignments_default},
${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/gld960.em b/ld/emultempl/gld960.em
index f407622..63b5bb3 100644
--- a/ld/emultempl/gld960.em
+++ b/ld/emultempl/gld960.em
@@ -134,7 +134,6 @@ struct ld_emulation_xfer_struct ld_gld960_emulation =
gld960_set_output_arch,
gld960_choose_target,
before_allocation_default,
- do_assignments_default,
gld960_get_script,
"960",
"",
diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em
index 5de01e6..6973a06 100644
--- a/ld/emultempl/gld960c.em
+++ b/ld/emultempl/gld960c.em
@@ -149,7 +149,6 @@ struct ld_emulation_xfer_struct ld_gld960coff_emulation =
gld960_set_output_arch,
gld960_choose_target,
before_allocation_default,
- do_assignments_default,
gld960_get_script,
"960coff",
"",
diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em
index 071af80..996a7ea 100644
--- a/ld/emultempl/linux.em
+++ b/ld/emultempl/linux.em
@@ -189,7 +189,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
gld${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em
index 1483983..95384d4 100644
--- a/ld/emultempl/lnk960.em
+++ b/ld/emultempl/lnk960.em
@@ -269,7 +269,6 @@ struct ld_emulation_xfer_struct ld_lnk960_emulation =
lnk960_set_output_arch,
lnk960_choose_target,
before_allocation_default,
- do_assignments_default,
lnk960_get_script,
"lnk960",
"",
diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em
index 31f98a0..4bf3994 100644
--- a/ld/emultempl/m68kcoff.em
+++ b/ld/emultempl/m68kcoff.em
@@ -222,7 +222,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
before_allocation_default,
- do_assignments_default,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 6e14330..df7692d 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1823,7 +1823,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
gld_${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld_${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
index ba59b80..e4d56de 100644
--- a/ld/emultempl/ppc32elf.em
+++ b/ld/emultempl/ppc32elf.em
@@ -117,23 +117,6 @@ ppc_before_allocation (void)
gld${EMULATION_NAME}_before_allocation ();
}
-static void
-ppc_do_assignments (void)
-{
- asection *s;
-
- if (is_ppc_elf32_vec (link_info.hash->creator))
- ppc_elf_set_sdata_syms (output_bfd, &link_info);
-
- s = bfd_get_section_by_name (output_bfd, ".sbss");
- _bfd_elf_provide_section_bound_symbols (&link_info, s,
- "__sbss_start", "__sbss_end");
- _bfd_elf_provide_section_bound_symbols (&link_info, s,
- "___sbss_start", "___sbss_end");
-
- gld${EMULATION_NAME}_provide_init_fini_syms ();
-}
-
EOF
# Define some shell vars to insert bits of code into the standard elf
@@ -177,4 +160,3 @@ PARSE_AND_LIST_ARGS_CASES='
#
LDEMUL_AFTER_OPEN=ppc_after_open
LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
-LDEMUL_DO_ASSIGNMENTS=ppc_do_assignments
diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em
index 19f1893..a480558 100644
--- a/ld/emultempl/sunos.em
+++ b/ld/emultempl/sunos.em
@@ -1013,7 +1013,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
gld${EMULATION_NAME}_before_allocation,
- do_assignments_default,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em
index 5938ba4..0382bbd 100644
--- a/ld/emultempl/ticoff.em
+++ b/ld/emultempl/ticoff.em
@@ -162,7 +162,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
set_output_arch_default,
ldemul_default_target,
before_allocation_default,
- do_assignments_default,
gld_${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
diff --git a/ld/emultempl/vanilla.em b/ld/emultempl/vanilla.em
index ad11f41..2124852 100644
--- a/ld/emultempl/vanilla.em
+++ b/ld/emultempl/vanilla.em
@@ -65,7 +65,6 @@ struct ld_emulation_xfer_struct ld_vanilla_emulation =
vanilla_set_output_arch,
ldemul_default_target,
before_allocation_default,
- do_assignments_default,
vanilla_get_script,
"vanilla",
"a.out-sunos-big",
diff --git a/ld/ldemul.c b/ld/ldemul.c
index 5b4796a..0ff11ce 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -80,12 +80,6 @@ ldemul_before_allocation (void)
}
void
-ldemul_do_assignments (void)
-{
- ld_emulation->do_assignments ();
-}
-
-void
ldemul_set_output_arch (void)
{
ld_emulation->set_output_arch ();
@@ -222,11 +216,6 @@ before_allocation_default (void)
}
void
-do_assignments_default (void)
-{
-}
-
-void
finish_default (void)
{
if (!link_info.relocatable)
diff --git a/ld/ldemul.h b/ld/ldemul.h
index c3ba033..44538d1 100644
--- a/ld/ldemul.h
+++ b/ld/ldemul.h
@@ -35,8 +35,6 @@ extern void ldemul_after_allocation
(void);
extern void ldemul_before_allocation
(void);
-extern void ldemul_do_assignments
- (void);
extern void ldemul_set_output_arch
(void);
extern char *ldemul_choose_target
@@ -79,7 +77,7 @@ extern void after_allocation_default
(void);
extern void before_allocation_default
(void);
-extern void do_assignments_default
+extern void finish_default
(void);
extern void finish_default
(void);
@@ -123,9 +121,6 @@ typedef struct ld_emulation_xfer_struct {
/* Run before allocating output sections. */
void (*before_allocation) (void);
- /* Run to set special symbols at the same time as link script syms. */
- void (*do_assignments) (void);
-
/* Return the appropriate linker script. */
char * (*get_script) (int *isfile);
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 038af17..fb5454c 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3056,9 +3056,7 @@ strip_excluded_output_sections (void)
{
lang_output_section_statement_type *os;
- /* Run lang_size_sections (if not already done) to ensure that all
- symbols defined in the linker script are put in the bfd hash
- table. */
+ /* Run lang_size_sections (if not already done). */
if (expld.phase != lang_mark_phase_enum)
{
expld.phase = lang_mark_phase_enum;
@@ -4591,7 +4589,6 @@ lang_do_assignments (void)
{
lang_statement_iteration++;
lang_do_assignments_1 (statement_list.head, abs_output_section, NULL, 0);
- ldemul_do_assignments ();
}
/* Fix any .startof. or .sizeof. symbols. When the assemblers see the
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 741d529..3ee8b43 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -123,10 +123,12 @@ STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
+ ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss)
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon)
+ ${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets
@@ -138,7 +140,11 @@ if test -z "${NO_SMALL_DATA}"; then
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}"
- SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
+ SDATA2=".sdata2 ${RELOCATING-0} :
+ {
+ ${RELOCATING+${SDATA2_START_SYMBOLS}}
+ *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
+ }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
@@ -376,10 +382,24 @@ cat <<EOF
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
- .preinit_array ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
- .init_array ${RELOCATING-0} : { KEEP (*(.init_array)) }
- .fini_array ${RELOCATING-0} : { KEEP (*(.fini_array)) }
-
+ .preinit_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+ KEEP (*(.preinit_array))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+ }
+ .init_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
+ KEEP (*(.init_array))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+ }
+ .fini_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+ KEEP (*(.fini_array))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+ }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }