From ac26ed81b6024190311ad772fb03882d37d84937 Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Thu, 21 Jan 2010 16:08:52 +0000 Subject: [PATCH] Executable: Move most rodata sections into the main rodata segment However, .interp remains to be moved. Removing the non-standard first PT_LOAD messes up PT_PHDR, which the Linux ld.so doesn't seem to like. --- ld/ldscripts/elf_nacl.x | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/ld/ldscripts/elf_nacl.x b/ld/ldscripts/elf_nacl.x index ff65a0471e..103e434a90 100644 --- a/ld/ldscripts/elf_nacl.x +++ b/ld/ldscripts/elf_nacl.x @@ -9,6 +9,30 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x1000000); . = 0x1000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ + .init : + { + KEEP (*(.init)) + . = ALIGN(32); /* ensures NOP fill */ + } =0x90909090 + .plt : { *(.plt) } + .text : + { + *(.text .stub .text.* .gnu.linkonce.t.*) + KEEP (*(.text.*personality*)) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + } =0x90909090 + .fini : + { + KEEP (*(.fini)) + /* Putting alignment inside section ensures we get NOP fill */ + . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ + } =0x90909090 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -43,29 +67,7 @@ SECTIONS .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } .rel.plt : { *(.rel.plt) } .rela.plt : { *(.rela.plt) } - . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ - .init : - { - KEEP (*(.init)) - . = ALIGN(32); /* ensures NOP fill */ - } =0x90909090 - .plt : { *(.plt) } - .text : - { - *(.text .stub .text.* .gnu.linkonce.t.*) - KEEP (*(.text.*personality*)) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } =0x90909090 - .fini : - { - KEEP (*(.fini)) - /* Putting alignment inside section ensures we get NOP fill */ - . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ - } =0x90909090 - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } -- 2.11.4.GIT