This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 0/6] ld: Add "-z textonly" option to ELF linker
On Wed, Jan 10, 2018 at 5:08 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jan 9, 2018 at 8:45 PM, Alan Modra <amodra@gmail.com> wrote:
>> On Wed, Jan 10, 2018 at 09:40:19AM +1030, Alan Modra wrote:
>>> that means a glibc change is needed (I think). Can we make ld.so
>>> clear out leading and trailing rubbish from PF_X segments for glibc
>>> 2.27?
>>
>> On second thoughts, that's not such a good idea. If we write to a
>> memory page it becomes unshared. So it seems we must align to
>> common-page-size.
>>
>
> LOAD segments needs to aligned to max-page-size. RELRO is
> optional, ignore it at run-time won't break programs.
>
I created users/hjl/pr22393/master branch. Now I got
Elf file type is DYN (Shared object file)
Entry point 0x220
There are 7 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x00200 0x00200 R 0x200000
LOAD 0x000200 0x00000200 0x00000200 0x0002b 0x0002b R E 0x200000
LOAD 0x00022b 0x0020022b 0x0020022b 0x00059 0x00059 R 0x200000
LOAD 0x000f80 0x00400f80 0x00400f80 0x000a0 0x000a0 RW 0x200000
DYNAMIC 0x000f80 0x00400f80 0x00400f80 0x00080 0x00080 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
GNU_RELRO 0x000f80 0x00400f80 0x00400f80 0x00080 0x00080 R 0x1
Section to Segment mapping:
Segment Sections...
00 .hash .gnu.hash .dynsym .dynstr .rela.plt
01 .plt .text
02 .rodata .eh_frame
03 .dynamic .got.plt
04 .dynamic
05
06 .dynamic
Will code page mapped from the code segment contain data?
--
H.J.