[RFC PATCH v3 3/4] RX: ld rx-linux target FDPIC support

Yoshinori Sato <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
	* emulparams/elf32rx_linux.sh: Add FDPIC sections.

Signed-off-by: Yoshinori Sato <[email protected]>
---
 ld/emulparams/elf32rx_linux.sh | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/ld/emulparams/elf32rx_linux.sh b/ld/emulparams/elf32rx_linux.sh
index 3abe4165d56..aded467de7b 100644
--- a/ld/emulparams/elf32rx_linux.sh
+++ b/ld/emulparams/elf32rx_linux.sh
@@ -4,14 +4,26 @@ OUTPUT_FORMAT="elf32-rx-linux"
 # See also `include/elf/rx.h'
 TEXT_START_ADDR=0x10000000
 ARCH=rx
-ENTRY=start
-EMBEDDED=yes
+ENTRY=_start
 TEMPLATE_NAME=elf
 EXTRA_EM_FILE=rxlinux
 ELFSIZE=32
-MAXPAGESIZE=256
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+# mul #1, r0
+NOP=0x76100100
+NO_SMALL_DATA=yes
 
-STACK_ADDR="(DEFINED(__stack) ? __stack : 0xbffffffc)"
-STACK_SENTINEL="LONG(0xdeaddead)"
-# We do not need .stack for shared library.
-test -n "$CREATE_SHLIB" && unset STACK_ADDR
+GOT=".got          ${RELOCATING-0} : {${RELOCATING+  *(.got) *(.got.funcdesc) *(.got.plt) } }"
+OTHER_GOT_RELOC_SECTIONS="
+  .rela.got.funcdesc      ${RELOCATING-0} : { *(.rela.got.funcdesc) }
+"
+OTHER_READONLY_SECTIONS="
+  .rofixup        : {
+    ${RELOCATING+__ROFIXUP_LIST__ = .;}
+    *(.rofixup)
+    ${RELOCATING+__ROFIXUP_END__ = .;}
+  }
+"
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.