This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Releases 2.27 and 2.26.1


On Tue, Jun 21, 2016 at 8:57 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>>> I'd like to create the 2.27 branch soon, and also to build the 2.26.1 release.
>>> If you have any pending patch you'd like to have in one of these releases, please speak quickly!
>>
>> I propose to turn on "-z relro" by default if supported.
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=20283
>
> Isn't it kind of late to be considering this for 2.27?

When is it not late?

> And doesn't GCC already pass -z relro by default anyway where it's supported?
>

Not in GCC 6:

[hjl@gnu-6 tmp]$  /usr/gcc-6.1.1-x32/bin/gcc  x.o -Wl,-z,relro
[hjl@gnu-6 tmp]$ readelf -l a.out

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

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                 0x00000000000001f8 0x00000000000001f8  R E    8
  INTERP         0x0000000000000238 0x0000000000400238 0x0000000000400238
                 0x000000000000001c 0x000000000000001c  R      1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
                 0x000000000000062c 0x000000000000062c  R E    200000
  LOAD           0x0000000000000e48 0x0000000000600e48 0x0000000000600e48
                 0x00000000000001e0 0x00000000000001e8  RW     200000
  DYNAMIC        0x0000000000000e60 0x0000000000600e60 0x0000000000600e60
                 0x0000000000000190 0x0000000000000190  RW     8
  NOTE           0x0000000000000254 0x0000000000400254 0x0000000000400254
                 0x0000000000000044 0x0000000000000044  R      4
  GNU_EH_FRAME   0x0000000000000534 0x0000000000400534 0x0000000000400534
                 0x000000000000002c 0x000000000000002c  R      4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     10
  GNU_RELRO      0x0000000000000e48 0x0000000000600e48 0x0000000000600e48
                 0x00000000000001b8 0x00000000000001b8  R      1

 Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .interp .note.ABI-tag .note.gnu.build-id .hash .dynsym
.dynstr .gnu.version .gnu.version_r .rela.dyn .init .text .fini
.rodata .eh_frame_hdr .eh_frame
   03     .init_array .fini_array .jcr .dynamic .got .got.plt .data .bss
   04     .dynamic
   05     .note.ABI-tag .note.gnu.build-id
   06     .eh_frame_hdr
   07
   08     .init_array .fini_array .jcr .dynamic .got
[hjl@gnu-6 tmp]$

However, -z relro has been enabled in Fedora since

commit 6b2ab95e1097b8917d2f8e2a82852b13126c9c61
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Mar 6 15:17:32 2012 +0000

    Enable -zrelro be default. (#621983)

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]