diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-08-25 09:42:20 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-06-22 06:04:17 -0700 |
commit | dc14c8980672194a1b329b5c35a7f781bc04a3f5 (patch) | |
tree | e3d6a419510c587892d5ca8abf5a7a199cd640fc /ld/scripttempl/elf.sc | |
parent | 6b1edb94fedc7103b4929354d27304d0bd756f49 (diff) | |
download | gdb-users/hjl/sharable.zip gdb-users/hjl/sharable.tar.gz gdb-users/hjl/sharable.tar.bz2 |
Add PT_GNU_SHR/SHF_GNU_SHARABLE/SHN_GNU_SHARABLE_COMMON support to gas/ldusers/hjl/sharable
PT_GNU_SHR/SHF_GNU_SHARABLE/SHN_GNU_SHARABLE_COMMON are used to group
data into a PT_GNU_SHR to improve performance on NUMA system.
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r-- | ld/scripttempl/elf.sc | 35 |
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} |