public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Reserve a few .dynamic entries
@ 2001-06-06  9:10 Jakub Jelinek
  2001-06-06 10:15 ` Hans-Peter Nilsson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jakub Jelinek @ 2001-06-06  9:10 UTC (permalink / raw)
  To: binutils

Hi!

As .dynamic section is usually located in between sections which may have
relocated relocations against, it is not possible after final link to insert
new .dynamic entries which e.g. prelinking needs to do.

The following patch inserts 6 DT_NULL ElfW(Dyn) entries at the end of
.dynamic (iff .dynamic section is created), so that post-link utilities can
just put the tags they need into those slots and don't have to copy the
whole .dynamic somewhere else (which would require new PT_LOAD segment
usually). It wastes 48 resp. 96 bytes if no prelinking or any other
post-link optimization is done.

Do you agree with this? Can I commit it?

2001-06-06  Jakub Jelinek  <jakub@redhat.com>

	* scripttempl/elf.sc (DYNAMIC): Reserve 6 ElfW(Dyn) entries for
	post-linking tools.

--- ld/scripttempl/elf.sc.jj	Sat Sep  2 22:43:22 2000
+++ ld/scripttempl/elf.sc	Wed Jun  6 17:59:17 2001
@@ -66,7 +66,7 @@ test -z "${ALIGNMENT}" && ALIGNMENT="${E
 test "$LD_FLAG" = "N" && DATA_ADDR=.
 INTERP=".interp   ${RELOCATING-0} : { *(.interp) 	}"
 PLT=".plt    ${RELOCATING-0} : { *(.plt)	}"
-DYNAMIC=".dynamic     ${RELOCATING-0} : { *(.dynamic) }"
+DYNAMIC=".dynamic     ${RELOCATING-0} : { *(.dynamic) ${RELOCATING+FILL(0) . += 6 * ${ELFSIZE} / 4; } }"
 RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }"
 SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }"
 SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }"

	Jakub

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

end of thread, other threads:[~2001-06-08 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06  9:10 [PATCH] Reserve a few .dynamic entries Jakub Jelinek
2001-06-06 10:15 ` Hans-Peter Nilsson
2001-06-08 11:13   ` [PATCH] Reserve a few .dynamic entries (take 2) Jakub Jelinek
2001-06-08 12:10     ` Hans-Peter Nilsson
2001-06-06 10:32 ` [PATCH] Reserve a few .dynamic entries Hans-Peter Nilsson
2001-06-06 16:45   ` Ben Elliston
2001-06-08 15:04 ` Ulrich Drepper

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).