################################################ # /etc/make.conf CFLAGS="-O2 -mcpu=ultrasparc -fPIE -fPIC" CHOST="sparc-unknown-linux-gnu" CXXFLAGS="${CFLAGS}" USE="pic pie hardened" LDFLAGS="-Wl,-z,now -Wl,-z,noexecheap -Wl,-z,noexecstack -Wl,-z,relro" ################################################# tachyon root # diff -u specs.orig specs ################################################# --- specs.orig 2004-05-02 04:04:44.239712000 +0000 +++ specs 2004-05-02 04:00:29.869712000 +0000 @@ -150,5 +150,5 @@ %{m32:%(asm_arch32)} %{m64:%(asm_arch64)} %{!m32:%{!m64:%(asm_arch_default)}} *link_command: -%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{!nopie: %{!A: %{!i: %{!r: %{!static: %{!nostdlib: %{!nostartfiles: %{!shared: -pie} } } -z relro} } } } } %{pie: } %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{!nopie: %{!A: %{!i: %{!r: %{!static: %{!nostdlib: %{!nostartfiles: %{!shared: -pie} } } -z now -z relro -z noexecstack -z noexecheap } } } } } %{pie: } %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} ################################################# tachyon root # readelf -l /sbin/chpax ################################################# Elf file type is DYN (Shared object file) Entry point 0xe48 There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00000154 0x00000154 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x02928 0x02928 R E 0x10000 LOAD 0x011e10 0x00011e10 0x00011e10 0x00338 0x003f0 RWE 0x10000 DYNAMIC 0x011e24 0x00011e24 0x00011e24 0x000d8 0x000d8 RW 0x4 NOTE 0x000168 0x00000168 0x00000168 0x00020 0x00020 R 0x4 STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 GNU_RELRO 0x011e10 0x00011e10 0x00011e10 0x001f4 0x001f4 R E 0x4 PAX_FLAGS 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .text .fini .rodata .eh_frame 03 .ctors .dtors .jcr .dynamic .got .plt .data .bss 04 .dynamic 05 .note.ABI-tag 06 07 .ctors .dtors .jcr .dynamic .got 08 ################################################# tachyon root # readelf -d /sbin/chpax ################################################# Dynamic segment at offset 0x11e24 contains 23 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0xe00 0x0000000d (FINI) 0x22a0 0x00000004 (HASH) 0x188 0x00000005 (STRTAB) 0x6e8 0x00000006 (SYMTAB) 0x318 0x0000000a (STRSZ) 549 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x12004 0x00000002 (PLTRELSZ) 264 (bytes) 0x00000014 (PLTREL) RELA 0x00000017 (JMPREL) 0xcec 0x00000007 (RELA) 0x9c8 0x00000008 (RELASZ) 1068 (bytes) 0x00000009 (RELAENT) 12 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x988 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x90e 0x6ffffff9 (RELACOUNT) 43 0x00000000 (NULL) 0x0 -------------------------------------------------