From 8634c1b4cb6d2531d1a7f068543bb61850099a1e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 11 Dec 2012 22:23:14 +0000 Subject: [PATCH] ld/ * emulparams/elf_nacl.sh (nacl_rodata_addr): New shell function. (RODATA_ADDR, SHLIB_RODATA_ADDR): Use it to base the calculation on SEGMENT_START("text-segment", ...) rather than ... alone. * Makefile.am (earmelf_nacl.c, earmelfb_nacl.c): Add missing dependency on $(srcdir)/emulparams/elf_nacl.sh. * Makefile.in: Regenerate. --- ld/ChangeLog | 9 +++++++++ ld/Makefile.am | 2 ++ ld/Makefile.in | 2 ++ ld/emulparams/elf_nacl.sh | 12 ++++++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 2ad773025a4..705c71235d2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2012-12-11 Roland McGrath + + * emulparams/elf_nacl.sh (nacl_rodata_addr): New shell function. + (RODATA_ADDR, SHLIB_RODATA_ADDR): Use it to base the calculation + on SEGMENT_START("text-segment", ...) rather than ... alone. + * Makefile.am (earmelf_nacl.c, earmelfb_nacl.c): Add missing + dependency on $(srcdir)/emulparams/elf_nacl.sh. + * Makefile.in: Regenerate. + 2012-12-05 H.J. Lu PR ld/14915 diff --git a/ld/Makefile.am b/ld/Makefile.am index 8c14295ce17..32f3d5141df 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -725,6 +725,7 @@ earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \ earmelf_nacl.c: $(srcdir)/emulparams/armelf_nacl.sh \ $(srcdir)/emulparams/armelf_linux_eabi.sh \ $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emulparams/elf_nacl.sh \ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_nacl "$(tdir_armelf_nacl)" @@ -758,6 +759,7 @@ earmelfb_nacl.c: $(srcdir)/emulparams/armelfb_nacl.sh \ $(srcdir)/emulparams/armelf_nacl.sh \ $(srcdir)/emulparams/armelf_linux_eabi.sh \ $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emulparams/elf_nacl.sh \ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelfb_nacl "$(tdir_armelfb_nacl)" diff --git a/ld/Makefile.in b/ld/Makefile.in index 98e8f0d82df..ce31edf9b7e 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -2198,6 +2198,7 @@ earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \ earmelf_nacl.c: $(srcdir)/emulparams/armelf_nacl.sh \ $(srcdir)/emulparams/armelf_linux_eabi.sh \ $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emulparams/elf_nacl.sh \ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_nacl "$(tdir_armelf_nacl)" @@ -2231,6 +2232,7 @@ earmelfb_nacl.c: $(srcdir)/emulparams/armelfb_nacl.sh \ $(srcdir)/emulparams/armelf_nacl.sh \ $(srcdir)/emulparams/armelf_linux_eabi.sh \ $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emulparams/elf_nacl.sh \ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelfb_nacl "$(tdir_armelfb_nacl)" diff --git a/ld/emulparams/elf_nacl.sh b/ld/emulparams/elf_nacl.sh index 0073c0f5b08..657cd06f13b 100644 --- a/ld/emulparams/elf_nacl.sh +++ b/ld/emulparams/elf_nacl.sh @@ -2,5 +2,13 @@ ENABLE_INITFINI_ARRAY=yes SEPARATE_CODE=yes TEXT_START_ADDR=0x20000 NACL_RODATA_DISTANCE=0x10000000 -RODATA_ADDR="${TEXT_START_ADDR} + ${NACL_RODATA_DISTANCE} + SIZEOF_HEADERS" -SHLIB_RODATA_ADDR="${NACL_RODATA_DISTANCE} + SIZEOF_HEADERS" + +nacl_rodata_addr() +{ + nacl_text_addr="SEGMENT_START(\"text-segment\", $1)" + nacl_rodata_addr="$nacl_text_addr + ${NACL_RODATA_DISTANCE} + SIZEOF_HEADERS" + echo "$nacl_rodata_addr" +} + +RODATA_ADDR=`nacl_rodata_addr "${TEXT_START_ADDR}"` +SHLIB_RODATA_ADDR=`nacl_rodata_addr 0` -- 2.30.2