bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/14215] New: ld creates bad GNU_RELRO segment


From: hjl.tools at gmail dot com
Subject: [Bug ld/14215] New: ld creates bad GNU_RELRO segment
Date: Sat, 09 Jun 2012 20:16:49 +0000

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

             Bug #: 14215
           Summary: ld creates bad GNU_RELRO segment
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


address@hidden relro-1]$ cat y.s
    .section .got
    .space 0x2a8, 4
    .data
    .zero 12
address@hidden relro-1]$ make
as --32  -o y.o y.s
./ld -m elf_i386 -z relro -shared -o y.so y.o
readelf -lW y.so

Elf file type is DYN (Shared object file)
Entry point 0x134
There are 4 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x00134 0x00134 R   0x1000
  LOAD           0x000cf4 0x00001cf4 0x00001cf4 0x0030c 0x0030c RW  0x1000
  DYNAMIC        0x000cf4 0x00001cf4 0x00001cf4 0x00058 0x00058 RW  0x4
  GNU_RELRO      0x000cf4 0x00001cf4 0x00001cf4 0x0030c 0x0030c R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr 
   01     .dynamic .got .data 
   02     .dynamic 
   03     .dynamic .got .data 
address@hidden relro-1]$ 

.data section is included in GNU_RELRO segment.  The
problem is caused by

  . = DATA_SEGMENT_RELRO_END (12, .);


It assumes the next 12 bytes after .got must be in .got.plt
section.  But it fails to check if the next section is .got.plt
section.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]