public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: N64, mark .interp as INITIAL_READONLY_SECTIONS
@ 2023-06-30  6:45 YunQiang Su
  2023-07-13  5:40 ` YunQiang Su
  2023-07-28  5:29 ` Maciej W. Rozycki
  0 siblings, 2 replies; 4+ messages in thread
From: YunQiang Su @ 2023-06-30  6:45 UTC (permalink / raw)
  To: binutils; +Cc: macro, YunQiang Su

In ld/emulparams/elf64bmip-defs.sh, there is no .interp, which make
the .interp section appears after some other less important sections.

Let's add it, and mark it as INITIAL_READONLY_SECTIONS, just like
O32/N32 do.

This changes fixes ld/pr23658-2.

ld/ChangeLog:
	* emulparams/elf64bmip-defs.sh: mark .interp as
	INITIAL_READONLY_SECTIONS.
	* testsuite/ld-mips-elf/pie-n64.d: adjust addresses.
---
 ld/emulparams/elf64bmip-defs.sh    |  6 +++++-
 ld/testsuite/ld-mips-elf/pie-n64.d | 12 ++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ld/emulparams/elf64bmip-defs.sh b/ld/emulparams/elf64bmip-defs.sh
index 4165f51e9e5..19d782d8e7a 100644
--- a/ld/emulparams/elf64bmip-defs.sh
+++ b/ld/emulparams/elf64bmip-defs.sh
@@ -1,6 +1,10 @@
 source_sh ${srcdir}/emulparams/elf32bmipn32-defs.sh
 COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-INITIAL_READONLY_SECTIONS="
+INITIAL_READONLY_SECTIONS=
+if test -z "${CREATE_SHLIB}"; then
+  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
+fi
+INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
   .MIPS.abiflags      ${RELOCATING-0} : { *(.MIPS.abiflags) }
   .MIPS.xhash      ${RELOCATING-0} : { *(.MIPS.xhash) }
   .MIPS.options : { *(.MIPS.options) }
diff --git a/ld/testsuite/ld-mips-elf/pie-n64.d b/ld/testsuite/ld-mips-elf/pie-n64.d
index bf7c6b2272a..1fda2512c8e 100644
--- a/ld/testsuite/ld-mips-elf/pie-n64.d
+++ b/ld/testsuite/ld-mips-elf/pie-n64.d
@@ -2,16 +2,16 @@
 #ld: -pie
 #readelf: -d
 
-Dynamic section at offset 0x208 contains 17 entries:
+Dynamic section at offset 0x220 contains 17 entries:
   Tag * Type * Name/Value
- 0x0+00000004 \(HASH\) * 0x368
- 0x0+00000005 \(STRTAB\) * 0x3c8
- 0x0+00000006 \(SYMTAB\) * 0x380
+ 0x0+00000004 \(HASH\) * 0x380
+ 0x0+00000005 \(STRTAB\) * 0x3e0
+ 0x0+00000006 \(SYMTAB\) * 0x398
  0x0+0000000a \(STRSZ\) * 28 \(bytes\)
  0x0+0000000b \(SYMENT\) * 24 \(bytes\)
- 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x101c8
+ 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x101a0
  0x0+00000015 \(DEBUG\) * 0x0
- 0x0+00000003 \(PLTGOT\) * 0x10430
+ 0x0+00000003 \(PLTGOT\) * 0x10420
  0x0+70000001 \(MIPS_RLD_VERSION\) * 1
  0x0+70000005 \(MIPS_FLAGS\) * NOTPOT
  0x0+70000006 \(MIPS_BASE_ADDRESS\) * 0x0
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-28  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30  6:45 [PATCH] MIPS: N64, mark .interp as INITIAL_READONLY_SECTIONS YunQiang Su
2023-07-13  5:40 ` YunQiang Su
2023-07-28  5:29 ` Maciej W. Rozycki
2023-07-28  5:50   ` YunQiang Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).