------- Additional Comments From hjl at lucon dot org  2006-08-14 23:20 -------
A testcase to show that -z relro may create PT_NULL segment:

[EMAIL PROTECTED] tmp]$ cat x.s
        .globl main
        .globl start
        .globl _start
        .globl __start
        .text
main:
start:
_start:
__start:
        .long   0
[EMAIL PROTECTED] tmp]$ gcc -c x.s
[EMAIL PROTECTED] tmp]$ ld  -z relro x.o
[EMAIL PROTECTED] tmp]$ readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x4000b0
There are 2 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
                 0x00000000000000b4 0x00000000000000b4  R E    200000
  NULL           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000         0

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl at lucon dot org
            Summary|-z relro by default causes  |-z relro may create PT_NULL
                   |testsuite failures          |segment


http://sourceware.org/bugzilla/show_bug.cgi?id=3015

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to