aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl/elf.sc
diff options
context:
space:
mode:
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r--ld/scripttempl/elf.sc35
1 files changed, 35 insertions, 0 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index f0c6439..24af0eb 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -308,6 +308,40 @@ STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
*(.stack)
}"
+test "${SHARABLE_SECTIONS}" = "yes" && OTHER_READWRITE_SECTIONS="
+ ${OTHER_READWRITE_SECTIONS}
+ /* Sharable data sections. */
+ .sharable_data ${RELOCATING-0} : ${RELOCATING+ALIGN(${MAXPAGESIZE})}
+ {
+ ${RELOCATING+PROVIDE_HIDDEN (__sharable_data_start = .);}
+ *(.sharable_data${RELOCATING+ .sharable_data.* .gnu.linkonce.shrd.*})
+ /* Align here to ensure that the sharable data section ends at the
+ page boundary. */
+ ${RELOCATING+. = ALIGN(. != 0 ? ${MAXPAGESIZE} : 1);}
+ ${RELOCATING+PROVIDE_HIDDEN (__sharable_data_end = .);}
+ }
+"
+test "${SHARABLE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
+ ${OTHER_BSS_SECTIONS}
+ /* Sharable bss sections */
+ .sharable_bss ${RELOCATING-0} : ${RELOCATING+ALIGN(${MAXPAGESIZE})}
+ {
+ ${RELOCATING+PROVIDE_HIDDEN (__sharable_bss_start = .);}
+ *(.dynsharablebss)
+ *(.sharable_bss${RELOCATING+ .sharable_bss.* .gnu.linkonce.shrb.*})
+ *(SHARABLE_COMMON)
+ /* Align here to ensure that the sharable bss section ends at the
+ page boundary. */
+ ${RELOCATING+. = ALIGN(. != 0 ? ${MAXPAGESIZE} : 1);}
+ ${RELOCATING+PROVIDE_HIDDEN (__sharable_bss_end = .);}
+ }
+"
+test "${SHARABLE_SECTIONS}" = "yes" && REL_SHARABLE="
+ .rel.sharable_data ${RELOCATING-0} : { *(.rel.sharable_data${RELOCATING+ .rel.sharable_data.* .rel.gnu.linkonce.shrd.*}) }
+ .rela.sharable_data ${RELOCATING-0} : { *(.rela.sharable_data${RELOCATING+ .rela.sharable_data.* .rela.gnu.linkonce.shrd.*}) }
+ .rel.sharable_bss ${RELOCATING-0} : { *(.rel.sharable_bss${RELOCATING+ .rel.sharable_bss.* .rel.gnu.linkonce.shrb.*}) }
+ .rela.sharable_bss ${RELOCATING-0} : { *(.rela.sharable_bss${RELOCATING+ .rela.sharable_bss.* .rela.gnu.linkonce.shrb.*}) }
+"
TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
@@ -408,6 +442,7 @@ eval $COMBRELOCCAT <<EOF
.rel.got ${RELOCATING-0} : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS}
+ ${REL_SHARABLE}
${REL_SDATA}
${REL_SBSS}
${REL_SDATA2}