Mock Version: 1.3.4 Mock Version: 1.3.4 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target ppc64 --nodeps /builddir/build/SPECS/hardening-wrapper.spec'], env={'TERM': 'vt100', 'HOME': '/builddir', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'HOSTNAME': 'mock', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8', 'SHELL': '/bin/bash', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}uid=1000timeout=172800user='mockbuild'shell=Falsegid=425logger=chrootPath='/var/lib/mock/f26-build-8831659-761050/root'nspawn_args=[]printOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target ppc64 --nodeps /builddir/build/SPECS/hardening-wrapper.spec'] with env {'TERM': 'vt100', 'HOME': '/builddir', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'HOSTNAME': 'mock', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8', 'SHELL': '/bin/bash', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False Building target platforms: ppc64 Building for target ppc64 Wrote: /builddir/build/SRPMS/hardening-wrapper-2.6-1.fc26.src.rpm Child return code was: 0 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target ppc64 --nodeps /builddir/build/SPECS/hardening-wrapper.spec'], env={'TERM': 'vt100', 'HOME': '/builddir', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'HOSTNAME': 'mock', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8', 'SHELL': '/bin/bash', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}uid=1000timeout=172800user='mockbuild'shell=Falsegid=425logger=chrootPath='/var/lib/mock/f26-build-8831659-761050/root'nspawn_args=[]printOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target ppc64 --nodeps /builddir/build/SPECS/hardening-wrapper.spec'] with env {'TERM': 'vt100', 'HOME': '/builddir', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'HOSTNAME': 'mock', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8', 'SHELL': '/bin/bash', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False Building target platforms: ppc64 Building for target ppc64 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wAzL54 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf hardening-wrapper-2.6 + /usr/bin/mkdir -p hardening-wrapper-2.6 + cd hardening-wrapper-2.6 + /usr/bin/xz -dc /builddir/build/SOURCES/hardening-wrapper_2.6.tar.xz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/sed -i.debian -e '/^[ \t]*if \[ -z \"\$.DEB_/d' hardening-wrapper/Makefile + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.fYWpFH + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/make -O -j4 -C hardening-wrapper make: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper' mkdir -p build-tree # Construct wrappers. install hardened-cc hardened-ld build-tree/ # Set defaults, based on OS and ARCH. perl -pi -e 's/ #OS#/ '""'/; s/ #ARCH#/ '""'/;' build-tree/hardened-cc build-tree/hardened-ld perl -pi -e "s/default{'DEB_BUILD_HARDENING_PIE'}=1;/default{'DEB_BUILD_HARDENING_PIE'}=0;/;" build-tree/hardened-cc build-tree/hardened-ld perl -pi -e "s/default{'DEB_BUILD_HARDENING_STACKPROTECTOR'}=1;/default{'DEB_BUILD_HARDENING_STACKPROTECTOR'}=1;/;" build-tree/hardened-cc build-tree/hardened-ld # Duplicate cc wrapper to c++. install build-tree/hardened-cc build-tree/hardened-c++ perl -pi -e 's/hardened-cc/hardened-c++/g; s|/usr/bin/cc|/usr/bin/c++|g;' build-tree/hardened-c++ # Construct tools. install hardening.make hardening-check build-tree/ # Do not use "shell" here because it eats newlines. We want those. perl -pi -e "s/^my %libc;/my %libc = (\n$(perl hardening-check --find-libc-functions /bin/ls)\n);/;" build-tree/hardening-check # Construct man pages. install hardened-cc.1 hardened-ld.1 build-tree/ pod2man hardening-check > build-tree/hardening-check.1 # Duplicate cc man page to c++. install build-tree/hardened-cc.1 build-tree/hardened-c++.1 perl -pi -e 's/hardened-cc/hardened-c++/g; s/gcc/g++/g;' build-tree/hardened-c++.1 touch build-tree/stamp-build make: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper' Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.IXofpk Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/default{ <-- HERE 'DEB_BUILD_HARDENING_PIE'}=1;/ at -e line 1. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/default{ <-- HERE 'DEB_BUILD_HARDENING_STACKPROTECTOR'}=1;/ at -e line 1. + exit 0 + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 ++ dirname /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 + cd hardening-wrapper-2.6 + /usr/bin/install -Dpm 0755 hardening-wrapper/build-tree/hardening-check /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/bin/hardening-check + /usr/bin/install -Dpm 0644 hardening-wrapper/build-tree/hardening-check.1 /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/man/man1/hardening-check.1 + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip /usr/bin/strip + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 + /usr/lib/rpm/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.Bi6qbX + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/make -O -j4 -C hardening-wrapper check make: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper' make -C tests check make[1]: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' # Check the stack protector and PIE options directly, just to have # a historical record in the build logs. cc -Wall -fstack-protector hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x1001feb8) cc -Wall -fstack-protector-strong hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x1001feb8) cc -Wall -fPIE -pie hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x2d77feb8) ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x327bfeb8) make -f Makefile.wrapper check make[2]: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' # Test basic perl syntax for script in ../build-tree/hardened-cc ../build-tree/hardened-ld ../build-tree/hardened-c++; do perl -c $script; done touch syntax.stamp # Compiler and linker options disabled. DEB_BUILD_HARDENING=0 ../build-tree/hardened-cc -B ../build-tree/ -o ../build-tree/wrapper-test-stock hello.c readelf -ldrsW ../build-tree/wrapper-test-stock Elf file type is EXEC (Executable file) Entry point 0x1001fe48 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x00091c 0x00091c R E 0x10000 LOAD 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x0003dc 0x0003e0 RW 0x10000 DYNAMIC 0x00fc98 0x000000001001fc98 0x000000001001fc98 0x0001b0 0x0001b0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000850 0x0000000010000850 0x0000000010000850 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x000378 0x000378 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .got .plt .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .got Dynamic section at offset 0xfc98 contains 22 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fe58 0x000000000000000d (FINI) 0x1001fe68 0x0000000000000019 (INIT_ARRAY) 0x1001fc88 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fc90 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000310 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 58 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x10020000 0x0000000000000002 (PLTRELSZ) 72 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x10000388 0x0000000070000000 (PPC64_GLINK) 0x100007b0 0x000000006ffffffe (VERNEED) 0x10000358 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x1000034a 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x388 contains 3 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000010020018 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 0000000010020030 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 printf@GLIBC_2.4 + 0 0000000010020048 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 4 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) Symbol table '.symtab' contains 63 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000310 0 SECTION LOCAL DEFAULT 6 7: 000000001000034a 0 SECTION LOCAL DEFAULT 7 8: 0000000010000358 0 SECTION LOCAL DEFAULT 8 9: 0000000010000388 0 SECTION LOCAL DEFAULT 9 10: 00000000100003d0 0 SECTION LOCAL DEFAULT 10 11: 0000000010000420 0 SECTION LOCAL DEFAULT 11 12: 00000000100007e8 0 SECTION LOCAL DEFAULT 12 13: 0000000010000808 0 SECTION LOCAL DEFAULT 13 14: 0000000010000850 0 SECTION LOCAL DEFAULT 14 15: 0000000010000880 0 SECTION LOCAL DEFAULT 15 16: 000000001001fc88 0 SECTION LOCAL DEFAULT 16 17: 000000001001fc90 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc98 0 SECTION LOCAL DEFAULT 18 19: 000000001001fe48 0 SECTION LOCAL DEFAULT 19 20: 000000001001ff00 0 SECTION LOCAL DEFAULT 20 21: 0000000010020000 0 SECTION LOCAL DEFAULT 21 22: 0000000010020060 0 SECTION LOCAL DEFAULT 22 23: 0000000010020064 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 26: 000000001001fe78 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 27: 000000001001fe88 0 FUNC LOCAL DEFAULT 19 register_tm_clones 28: 000000001001fe98 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 29: 0000000010020064 1 OBJECT LOCAL DEFAULT 23 completed.8892 30: 000000001001fc90 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 31: 000000001001fea8 0 FUNC LOCAL DEFAULT 19 frame_dummy 32: 000000001001fc88 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 33: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000918 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 0000000010000448 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.snprintf@@GLIBC_2.4 38: 0000000010000798 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 39: 000000001001fc90 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 40: 0000000010000434 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.printf@@GLIBC_2.4 41: 000000001001fc98 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 42: 000000001001fc88 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 43: 0000000010000850 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 44: 0000000010000420 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.__libc_start_main@@GLIBC_2.3 45: 000000001001fee8 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 46: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 47: 0000000010020060 0 NOTYPE WEAK DEFAULT 22 data_start 48: 0000000000000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 49: 0000000010020064 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fe68 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000010020060 0 NOTYPE GLOBAL DEFAULT 22 __data_start 52: 0000000010000830 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 53: 000000001001feb8 128 FUNC GLOBAL DEFAULT 19 announcement 54: 0000000010000828 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 55: 000000001001fed8 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 56: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 57: 0000000010020068 0 NOTYPE GLOBAL DEFAULT 23 _end 58: 000000001001fe48 60 FUNC GLOBAL DEFAULT 19 _start 59: 0000000010020064 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 60: 000000001001fec8 120 FUNC GLOBAL DEFAULT 19 main 61: 0000000010020068 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 62: 000000001001fe58 0 FUNC GLOBAL DEFAULT 19 _init ../build-tree/wrapper-test-stock ../build-tree/wrapper-test-stock: ok (0x1001feb8) # Compiler options enabled. (linker is not wrapper) ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-compiled hello.c readelf -ldrsW ../build-tree/wrapper-test-compiled Elf file type is EXEC (Executable file) Entry point 0x1001fe48 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000954 0x000954 R E 0x10000 LOAD 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x0003f4 0x0003f8 RW 0x10000 DYNAMIC 0x00fc98 0x000000001001fc98 0x000000001001fc98 0x0001b0 0x0001b0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000888 0x0000000010000888 0x0000000010000888 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x000378 0x000378 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .got .plt .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .got Dynamic section at offset 0xfc98 contains 22 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fe58 0x000000000000000d (FINI) 0x1001fe68 0x0000000000000019 (INIT_ARRAY) 0x1001fc88 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fc90 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000328 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 88 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x10020000 0x0000000000000002 (PLTRELSZ) 96 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x100003c0 0x0000000070000000 (PPC64_GLINK) 0x100007e0 0x000000006ffffffe (VERNEED) 0x10000390 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x10000380 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x3c0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000010020018 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 0000000010020030 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 __stack_chk_fail@GLIBC_2.4 + 0 0000000010020048 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 0000000010020060 0000000400000015 R_PPC64_JMP_SLOT 0000000000000000 __printf_chk@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (3) Symbol table '.symtab' contains 65 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000328 0 SECTION LOCAL DEFAULT 6 7: 0000000010000380 0 SECTION LOCAL DEFAULT 7 8: 0000000010000390 0 SECTION LOCAL DEFAULT 8 9: 00000000100003c0 0 SECTION LOCAL DEFAULT 9 10: 0000000010000420 0 SECTION LOCAL DEFAULT 10 11: 0000000010000460 0 SECTION LOCAL DEFAULT 11 12: 0000000010000820 0 SECTION LOCAL DEFAULT 12 13: 0000000010000840 0 SECTION LOCAL DEFAULT 13 14: 0000000010000888 0 SECTION LOCAL DEFAULT 14 15: 00000000100008b8 0 SECTION LOCAL DEFAULT 15 16: 000000001001fc88 0 SECTION LOCAL DEFAULT 16 17: 000000001001fc90 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc98 0 SECTION LOCAL DEFAULT 18 19: 000000001001fe48 0 SECTION LOCAL DEFAULT 19 20: 000000001001ff00 0 SECTION LOCAL DEFAULT 20 21: 0000000010020000 0 SECTION LOCAL DEFAULT 21 22: 0000000010020078 0 SECTION LOCAL DEFAULT 22 23: 000000001002007c 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 26: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 27: 000000001001fe78 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 28: 000000001001fe88 0 FUNC LOCAL DEFAULT 19 register_tm_clones 29: 000000001001fe98 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 30: 000000001002007c 1 OBJECT LOCAL DEFAULT 23 completed.8892 31: 000000001001fc90 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 32: 000000001001fea8 0 FUNC LOCAL DEFAULT 19 frame_dummy 33: 000000001001fc88 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000950 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 000000001000049c 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__libc_start_main@@GLIBC_2.3 38: 0000000010000488 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.snprintf@@GLIBC_2.4 39: 0000000010000460 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__printf_chk@@GLIBC_2.4 40: 00000000100007c8 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 41: 0000000010000474 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 42: 000000001001fc90 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 43: 000000001001fc98 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 44: 000000001001fc88 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 45: 0000000010000888 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 46: 000000001001fee8 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 47: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 48: 0000000010020078 0 NOTYPE WEAK DEFAULT 22 data_start 49: 000000001002007c 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fe68 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 52: 0000000010020078 0 NOTYPE GLOBAL DEFAULT 22 __data_start 53: 0000000010000868 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 54: 000000001001feb8 140 FUNC GLOBAL DEFAULT 19 announcement 55: 0000000010000860 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 56: 000000001001fed8 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 57: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 58: 0000000010020080 0 NOTYPE GLOBAL DEFAULT 23 _end 59: 000000001001fe48 60 FUNC GLOBAL DEFAULT 19 _start 60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 61: 000000001002007c 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 62: 000000001001fec8 60 FUNC GLOBAL DEFAULT 19 main 63: 0000000010020080 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 64: 000000001001fe58 0 FUNC GLOBAL DEFAULT 19 _init # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x1001feb8) ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x1001feb8) # Enable symlink for ld to trick gcc into doing wrapped linking (cd ../build-tree && ln -s hardened-ld ld) (cd ../build-tree && ln -s hardened-ld ld.gold) # Compiler and linker options enabled. ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-linked hello.c readelf -ldrsW ../build-tree/wrapper-test-linked Elf file type is EXEC (Executable file) Entry point 0x1001fdd0 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000964 0x000964 R E 0x10000 LOAD 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000414 0x000418 RW 0x10000 DYNAMIC 0x00fc00 0x000000001001fc00 0x000000001001fc00 0x0001d0 0x0001d0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000898 0x0000000010000898 0x0000000010000898 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000410 0x000410 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .plt .got .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .plt .got Dynamic section at offset 0xfc00 contains 24 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fde0 0x000000000000000d (FINI) 0x1001fdf0 0x0000000000000019 (INIT_ARRAY) 0x1001fbf0 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fbf8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000328 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 88 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x1001fe88 0x0000000000000002 (PLTRELSZ) 96 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x100003c0 0x0000000070000000 (PPC64_GLINK) 0x100007f0 0x0000000000000018 (BIND_NOW) 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x10000390 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x10000380 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x3c0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000001001fea0 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 000000001001feb8 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 __stack_chk_fail@GLIBC_2.4 + 0 000000001001fed0 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 000000001001fee8 0000000400000015 R_PPC64_JMP_SLOT 0000000000000000 __printf_chk@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (3) Symbol table '.symtab' contains 65 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000328 0 SECTION LOCAL DEFAULT 6 7: 0000000010000380 0 SECTION LOCAL DEFAULT 7 8: 0000000010000390 0 SECTION LOCAL DEFAULT 8 9: 00000000100003c0 0 SECTION LOCAL DEFAULT 9 10: 0000000010000420 0 SECTION LOCAL DEFAULT 10 11: 0000000010000460 0 SECTION LOCAL DEFAULT 11 12: 0000000010000830 0 SECTION LOCAL DEFAULT 12 13: 0000000010000850 0 SECTION LOCAL DEFAULT 13 14: 0000000010000898 0 SECTION LOCAL DEFAULT 14 15: 00000000100008c8 0 SECTION LOCAL DEFAULT 15 16: 000000001001fbf0 0 SECTION LOCAL DEFAULT 16 17: 000000001001fbf8 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc00 0 SECTION LOCAL DEFAULT 18 19: 000000001001fdd0 0 SECTION LOCAL DEFAULT 19 20: 000000001001fe88 0 SECTION LOCAL DEFAULT 20 21: 000000001001ff00 0 SECTION LOCAL DEFAULT 21 22: 0000000010020000 0 SECTION LOCAL DEFAULT 22 23: 0000000010020004 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 26: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 27: 000000001001fe00 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 28: 000000001001fe10 0 FUNC LOCAL DEFAULT 19 register_tm_clones 29: 000000001001fe20 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 30: 0000000010020004 1 OBJECT LOCAL DEFAULT 23 completed.8892 31: 000000001001fbf8 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 32: 000000001001fe30 0 FUNC LOCAL DEFAULT 19 frame_dummy 33: 000000001001fbf0 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000960 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 00000000100004a8 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__libc_start_main@@GLIBC_2.3 38: 0000000010000490 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.snprintf@@GLIBC_2.4 39: 0000000010000460 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__printf_chk@@GLIBC_2.4 40: 00000000100007d8 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 41: 0000000010000478 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 42: 000000001001fbf8 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 43: 000000001001fc00 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 44: 000000001001fbf0 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 45: 0000000010000898 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 46: 000000001001fe70 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 47: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 48: 0000000010020000 0 NOTYPE WEAK DEFAULT 22 data_start 49: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fdf0 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 52: 0000000010020000 0 NOTYPE GLOBAL DEFAULT 22 __data_start 53: 0000000010000878 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 54: 000000001001fe40 140 FUNC GLOBAL DEFAULT 19 announcement 55: 0000000010000870 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 56: 000000001001fe60 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 57: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 58: 0000000010020008 0 NOTYPE GLOBAL DEFAULT 23 _end 59: 000000001001fdd0 60 FUNC GLOBAL DEFAULT 19 _start 60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 61: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 62: 000000001001fe50 60 FUNC GLOBAL DEFAULT 19 main 63: 0000000010020008 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 64: 000000001001fde0 0 FUNC GLOBAL DEFAULT 19 _init # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x1001fe40) ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x1001fe40) # Check state of hardening features via check script perl ../build-tree/hardening-check -p ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: Position Independent Executable: no, normal executable! (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: yes Immediate binding: yes # Manually check state of hardening features # Skipped PIE test # Test Stack Protector nm ../build-tree/wrapper-test-linked | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000478 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 # Test Fortify nm ../build-tree/wrapper-test-linked | egrep '__(sn)?printf_chk($|@@GLIBC)' 0000000010000460 t 0000003c.plt_call.__printf_chk@@GLIBC_2.4 U __printf_chk@@GLIBC_2.4 # Test Format (no-op currently) # Test for RELRO readelf -lW ../build-tree/wrapper-test-linked | grep GNU_RELRO GNU_RELRO 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000410 0x000410 R 0x1 # Test for BIND_NOW readelf -dW ../build-tree/wrapper-test-linked | grep BIND_NOW 0x0000000000000018 (BIND_NOW) # Build directly with -fPIC already defined ../build-tree/hardened-cc -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC-direct hello.c ../build-tree/wrapper-test-fPIC-direct ../build-tree/wrapper-test-fPIC-direct: ok (0x1001fe40) # Build .o with -fPIC already defined ../build-tree/hardened-cc -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC.o -c hello.c # Link .o with -fPIC already defined ../build-tree/hardened-cc -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC.o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC: ok (0x1001fe40) # Make sure build fails due to -Werror=format-security ! ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-format-security format.c # Make sure build succeeds with -Wno-format-security ../build-tree/hardened-cc -B ../build-tree/ -O2 -Wno-format-security -o ../build-tree/wrapper-test-format-security format.c # Make sure build stack-protects a small ssp buffer ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-size-protect ssp-buffer-size-protect.c # Test Stack Protector nm ../build-tree/wrapper-test-ssp-buffer-size-protect | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000478 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 # Make sure build stack-protects a non-char array ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-type-protect ssp-buffer-type-protect.c # Test Stack Protector nm ../build-tree/wrapper-test-ssp-buffer-type-protect | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000438 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 ../build-tree/hardened-cc -B ../build-tree/ -O2 -c -o ../build-tree/wrapper-test-all.o hello.c ar r ../build-tree/wrapper-test-all.a ../build-tree/wrapper-test-all.o readelf -ldrsW ../build-tree/wrapper-test-all.a File: ../build-tree/wrapper-test-all.a(wrapper-test-all.o) There are no program headers in this file. Relocation section '.rela.text' at offset 0x328 contains 9 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000006 0000000700000032 R_PPC64_TOC16_HA 0000000000000000 .rodata.str1.8 + 0 000000000000000e 0000000700000030 R_PPC64_TOC16_LO 0000000000000000 .rodata.str1.8 + 0 000000000000002c 0000000b0000000a R_PPC64_REL24 0000000000000000 snprintf + 0 0000000000000036 0000000a00000032 R_PPC64_TOC16_HA 0000000000000000 announcement + 0 000000000000003a 0000000700000032 R_PPC64_TOC16_HA 0000000000000000 .rodata.str1.8 + 8 0000000000000042 0000000a00000030 R_PPC64_TOC16_LO 0000000000000000 announcement + 0 0000000000000046 0000000700000030 R_PPC64_TOC16_LO 0000000000000000 .rodata.str1.8 + 8 000000000000004c 0000000c0000000a R_PPC64_REL24 0000000000000000 __printf_chk + 0 0000000000000078 0000000d0000000a R_PPC64_REL24 0000000000000000 __stack_chk_fail + 0 Relocation section '.rela.opd' at offset 0x400 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 0 0000000000000008 0000000000000033 R_PPC64_TOC 0 0000000000000010 0000000600000026 R_PPC64_ADDR64 0000000000000000 .text.startup + 0 0000000000000018 0000000000000033 R_PPC64_TOC 0 Relocation section '.rela.text.startup' at offset 0x460 contains 1 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000010 0000000a0000000a R_PPC64_REL24 0000000000000000 announcement + 0 Symbol table '.symtab' contains 15 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 0000000000000000 0 SECTION LOCAL DEFAULT 1 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 4: 0000000000000000 0 SECTION LOCAL DEFAULT 4 5: 0000000000000000 0 SECTION LOCAL DEFAULT 5 6: 0000000000000000 0 SECTION LOCAL DEFAULT 7 7: 0000000000000000 0 SECTION LOCAL DEFAULT 9 8: 0000000000000000 0 SECTION LOCAL DEFAULT 11 9: 0000000000000000 0 SECTION LOCAL DEFAULT 10 10: 0000000000000000 140 FUNC GLOBAL DEFAULT 5 announcement 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 12: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 13: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail 14: 0000000000000010 60 FUNC GLOBAL DEFAULT 5 main perl ../build-tree/hardening-check -p ../build-tree/wrapper-test-all.a ../build-tree/wrapper-test-all.a: Position Independent Executable: no, object archive (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: no, non-ELF (ignored) Immediate binding: no, non-ELF (ignored) DEB_BUILD_HARDENING=0 ../build-tree/hardened-cc -B ../build-tree/ -c -o ../build-tree/wrapper-test-none.o hello.c ar r ../build-tree/wrapper-test-none.a ../build-tree/wrapper-test-none.o readelf -ldrsW ../build-tree/wrapper-test-none.a File: ../build-tree/wrapper-test-none.a(wrapper-test-none.o) There are no program headers in this file. Relocation section '.rela.text' at offset 0x300 contains 9 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001e 0000000500000032 R_PPC64_TOC16_HA 0000000000000000 .rodata + 0 0000000000000022 0000000500000030 R_PPC64_TOC16_LO 0000000000000000 .rodata + 0 0000000000000030 0000000a0000000a R_PPC64_REL24 0000000000000000 snprintf + 0 000000000000003a 0000000900000032 R_PPC64_TOC16_HA 0000000000000000 announcement + 0 000000000000003e 0000000900000030 R_PPC64_TOC16_LO 0000000000000000 announcement + 0 000000000000004a 0000000500000032 R_PPC64_TOC16_HA 0000000000000000 .rodata + 8 000000000000004e 0000000500000030 R_PPC64_TOC16_LO 0000000000000000 .rodata + 8 0000000000000050 0000000b0000000a R_PPC64_REL24 0000000000000000 printf + 0 00000000000000ac 000000090000000a R_PPC64_REL24 0000000000000000 announcement + 0 Relocation section '.rela.opd' at offset 0x3d8 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 0 0000000000000008 0000000000000033 R_PPC64_TOC 0 0000000000000010 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 80 0000000000000018 0000000000000033 R_PPC64_TOC 0 Symbol table '.symtab' contains 13 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 0000000000000000 0 SECTION LOCAL DEFAULT 1 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 4: 0000000000000000 0 SECTION LOCAL DEFAULT 4 5: 0000000000000000 0 SECTION LOCAL DEFAULT 5 6: 0000000000000000 0 SECTION LOCAL DEFAULT 6 7: 0000000000000000 0 SECTION LOCAL DEFAULT 9 8: 0000000000000000 0 SECTION LOCAL DEFAULT 8 9: 0000000000000000 128 FUNC GLOBAL DEFAULT 6 announcement 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND printf 12: 0000000000000010 120 FUNC GLOBAL DEFAULT 6 main if perl ../build-tree/hardening-check -p ../build-tree/wrapper-test-none.a; then exit 1; fi ../build-tree/wrapper-test-none.a: Position Independent Executable: no, object archive (ignored) Stack protected: no, not found! Fortify Source functions: no, only unprotected functions found! Read-only relocations: no, non-ELF (ignored) Immediate binding: no, non-ELF (ignored) make[2]: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make -f Makefile.includes check make[2]: Entering directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' # Compiler and linker options disabled. DEB_BUILD_HARDENING=0 cc -o ../build-tree/includes-test-stock hello.c readelf -ldrsW ../build-tree/includes-test-stock Elf file type is EXEC (Executable file) Entry point 0x1001fe48 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x00091c 0x00091c R E 0x10000 LOAD 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x0003dc 0x0003e0 RW 0x10000 DYNAMIC 0x00fc98 0x000000001001fc98 0x000000001001fc98 0x0001b0 0x0001b0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000850 0x0000000010000850 0x0000000010000850 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fc88 0x000000001001fc88 0x000000001001fc88 0x000378 0x000378 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .got .plt .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .got Dynamic section at offset 0xfc98 contains 22 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fe58 0x000000000000000d (FINI) 0x1001fe68 0x0000000000000019 (INIT_ARRAY) 0x1001fc88 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fc90 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000310 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 58 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x10020000 0x0000000000000002 (PLTRELSZ) 72 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x10000388 0x0000000070000000 (PPC64_GLINK) 0x100007b0 0x000000006ffffffe (VERNEED) 0x10000358 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x1000034a 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x388 contains 3 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000010020018 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 0000000010020030 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 printf@GLIBC_2.4 + 0 0000000010020048 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 4 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) Symbol table '.symtab' contains 63 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000310 0 SECTION LOCAL DEFAULT 6 7: 000000001000034a 0 SECTION LOCAL DEFAULT 7 8: 0000000010000358 0 SECTION LOCAL DEFAULT 8 9: 0000000010000388 0 SECTION LOCAL DEFAULT 9 10: 00000000100003d0 0 SECTION LOCAL DEFAULT 10 11: 0000000010000420 0 SECTION LOCAL DEFAULT 11 12: 00000000100007e8 0 SECTION LOCAL DEFAULT 12 13: 0000000010000808 0 SECTION LOCAL DEFAULT 13 14: 0000000010000850 0 SECTION LOCAL DEFAULT 14 15: 0000000010000880 0 SECTION LOCAL DEFAULT 15 16: 000000001001fc88 0 SECTION LOCAL DEFAULT 16 17: 000000001001fc90 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc98 0 SECTION LOCAL DEFAULT 18 19: 000000001001fe48 0 SECTION LOCAL DEFAULT 19 20: 000000001001ff00 0 SECTION LOCAL DEFAULT 20 21: 0000000010020000 0 SECTION LOCAL DEFAULT 21 22: 0000000010020060 0 SECTION LOCAL DEFAULT 22 23: 0000000010020064 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 26: 000000001001fe78 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 27: 000000001001fe88 0 FUNC LOCAL DEFAULT 19 register_tm_clones 28: 000000001001fe98 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 29: 0000000010020064 1 OBJECT LOCAL DEFAULT 23 completed.8892 30: 000000001001fc90 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 31: 000000001001fea8 0 FUNC LOCAL DEFAULT 19 frame_dummy 32: 000000001001fc88 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 33: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000918 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 0000000010000448 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.snprintf@@GLIBC_2.4 38: 0000000010000798 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 39: 000000001001fc90 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 40: 0000000010000434 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.printf@@GLIBC_2.4 41: 000000001001fc98 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 42: 000000001001fc88 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 43: 0000000010000850 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 44: 0000000010000420 0 NOTYPE LOCAL DEFAULT 11 00000017.plt_call.__libc_start_main@@GLIBC_2.3 45: 000000001001fee8 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 46: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 47: 0000000010020060 0 NOTYPE WEAK DEFAULT 22 data_start 48: 0000000000000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 49: 0000000010020064 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fe68 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000010020060 0 NOTYPE GLOBAL DEFAULT 22 __data_start 52: 0000000010000830 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 53: 000000001001feb8 128 FUNC GLOBAL DEFAULT 19 announcement 54: 0000000010000828 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 55: 000000001001fed8 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 56: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 57: 0000000010020068 0 NOTYPE GLOBAL DEFAULT 23 _end 58: 000000001001fe48 60 FUNC GLOBAL DEFAULT 19 _start 59: 0000000010020064 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 60: 000000001001fec8 120 FUNC GLOBAL DEFAULT 19 main 61: 0000000010020068 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 62: 000000001001fe58 0 FUNC GLOBAL DEFAULT 19 _init ../build-tree/includes-test-stock ../build-tree/includes-test-stock: ok (0x1001feb8) # Compiler options enabled. (linker is not wrapper) cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-compiled hello.c readelf -ldrsW ../build-tree/includes-test-compiled Elf file type is EXEC (Executable file) Entry point 0x1001fdd0 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000964 0x000964 R E 0x10000 LOAD 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000414 0x000418 RW 0x10000 DYNAMIC 0x00fc00 0x000000001001fc00 0x000000001001fc00 0x0001d0 0x0001d0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000898 0x0000000010000898 0x0000000010000898 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000410 0x000410 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .plt .got .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .plt .got Dynamic section at offset 0xfc00 contains 24 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fde0 0x000000000000000d (FINI) 0x1001fdf0 0x0000000000000019 (INIT_ARRAY) 0x1001fbf0 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fbf8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000328 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 88 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x1001fe88 0x0000000000000002 (PLTRELSZ) 96 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x100003c0 0x0000000070000000 (PPC64_GLINK) 0x100007f0 0x0000000000000018 (BIND_NOW) 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x10000390 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x10000380 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x3c0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000001001fea0 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 000000001001feb8 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 __stack_chk_fail@GLIBC_2.4 + 0 000000001001fed0 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 000000001001fee8 0000000400000015 R_PPC64_JMP_SLOT 0000000000000000 __printf_chk@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (3) Symbol table '.symtab' contains 65 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000328 0 SECTION LOCAL DEFAULT 6 7: 0000000010000380 0 SECTION LOCAL DEFAULT 7 8: 0000000010000390 0 SECTION LOCAL DEFAULT 8 9: 00000000100003c0 0 SECTION LOCAL DEFAULT 9 10: 0000000010000420 0 SECTION LOCAL DEFAULT 10 11: 0000000010000460 0 SECTION LOCAL DEFAULT 11 12: 0000000010000830 0 SECTION LOCAL DEFAULT 12 13: 0000000010000850 0 SECTION LOCAL DEFAULT 13 14: 0000000010000898 0 SECTION LOCAL DEFAULT 14 15: 00000000100008c8 0 SECTION LOCAL DEFAULT 15 16: 000000001001fbf0 0 SECTION LOCAL DEFAULT 16 17: 000000001001fbf8 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc00 0 SECTION LOCAL DEFAULT 18 19: 000000001001fdd0 0 SECTION LOCAL DEFAULT 19 20: 000000001001fe88 0 SECTION LOCAL DEFAULT 20 21: 000000001001ff00 0 SECTION LOCAL DEFAULT 21 22: 0000000010020000 0 SECTION LOCAL DEFAULT 22 23: 0000000010020004 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 26: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 27: 000000001001fe00 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 28: 000000001001fe10 0 FUNC LOCAL DEFAULT 19 register_tm_clones 29: 000000001001fe20 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 30: 0000000010020004 1 OBJECT LOCAL DEFAULT 23 completed.8892 31: 000000001001fbf8 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 32: 000000001001fe30 0 FUNC LOCAL DEFAULT 19 frame_dummy 33: 000000001001fbf0 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000960 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 00000000100004a8 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__libc_start_main@@GLIBC_2.3 38: 0000000010000490 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.snprintf@@GLIBC_2.4 39: 0000000010000460 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__printf_chk@@GLIBC_2.4 40: 00000000100007d8 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 41: 0000000010000478 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 42: 000000001001fbf8 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 43: 000000001001fc00 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 44: 000000001001fbf0 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 45: 0000000010000898 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 46: 000000001001fe70 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 47: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 48: 0000000010020000 0 NOTYPE WEAK DEFAULT 22 data_start 49: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fdf0 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 52: 0000000010020000 0 NOTYPE GLOBAL DEFAULT 22 __data_start 53: 0000000010000878 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 54: 000000001001fe40 140 FUNC GLOBAL DEFAULT 19 announcement 55: 0000000010000870 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 56: 000000001001fe60 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 57: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 58: 0000000010020008 0 NOTYPE GLOBAL DEFAULT 23 _end 59: 000000001001fdd0 60 FUNC GLOBAL DEFAULT 19 _start 60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 61: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 62: 000000001001fe50 60 FUNC GLOBAL DEFAULT 19 main 63: 0000000010020008 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 64: 000000001001fde0 0 FUNC GLOBAL DEFAULT 19 _init # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x1001fe40) ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x1001fe40) # Compiler and linker options enabled. cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-linked hello.c readelf -ldrsW ../build-tree/includes-test-linked Elf file type is EXEC (Executable file) Entry point 0x1001fdd0 There are 9 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001f8 0x0001f8 R E 0x8 INTERP 0x000238 0x0000000010000238 0x0000000010000238 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000964 0x000964 R E 0x10000 LOAD 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000414 0x000418 RW 0x10000 DYNAMIC 0x00fc00 0x000000001001fc00 0x000000001001fc00 0x0001d0 0x0001d0 RW 0x8 NOTE 0x00024c 0x000000001000024c 0x000000001000024c 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x000898 0x0000000010000898 0x0000000010000898 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 GNU_RELRO 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000410 0x000410 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .plt .got .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 08 .init_array .fini_array .dynamic .opd .plt .got Dynamic section at offset 0xfc00 contains 24 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1001fde0 0x000000000000000d (FINI) 0x1001fdf0 0x0000000000000019 (INIT_ARRAY) 0x1001fbf0 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1001fbf8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000290 0x0000000000000005 (STRTAB) 0x10000328 0x0000000000000006 (SYMTAB) 0x100002b0 0x000000000000000a (STRSZ) 88 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x1001fe88 0x0000000000000002 (PLTRELSZ) 96 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x100003c0 0x0000000070000000 (PPC64_GLINK) 0x100007f0 0x0000000000000018 (BIND_NOW) 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x10000390 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x10000380 0x0000000000000000 (NULL) 0x0 Relocation section '.rela.plt' at offset 0x3c0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000001001fea0 0000000100000015 R_PPC64_JMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.3 + 0 000000001001feb8 0000000200000015 R_PPC64_JMP_SLOT 0000000000000000 __stack_chk_fail@GLIBC_2.4 + 0 000000001001fed0 0000000300000015 R_PPC64_JMP_SLOT 0000000000000000 snprintf@GLIBC_2.4 + 0 000000001001fee8 0000000400000015 R_PPC64_JMP_SLOT 0000000000000000 __printf_chk@GLIBC_2.4 + 0 Symbol table '.dynsym' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.3 (2) 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (3) Symbol table '.symtab' contains 65 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000010000238 0 SECTION LOCAL DEFAULT 1 2: 000000001000024c 0 SECTION LOCAL DEFAULT 2 3: 000000001000026c 0 SECTION LOCAL DEFAULT 3 4: 0000000010000290 0 SECTION LOCAL DEFAULT 4 5: 00000000100002b0 0 SECTION LOCAL DEFAULT 5 6: 0000000010000328 0 SECTION LOCAL DEFAULT 6 7: 0000000010000380 0 SECTION LOCAL DEFAULT 7 8: 0000000010000390 0 SECTION LOCAL DEFAULT 8 9: 00000000100003c0 0 SECTION LOCAL DEFAULT 9 10: 0000000010000420 0 SECTION LOCAL DEFAULT 10 11: 0000000010000460 0 SECTION LOCAL DEFAULT 11 12: 0000000010000830 0 SECTION LOCAL DEFAULT 12 13: 0000000010000850 0 SECTION LOCAL DEFAULT 13 14: 0000000010000898 0 SECTION LOCAL DEFAULT 14 15: 00000000100008c8 0 SECTION LOCAL DEFAULT 15 16: 000000001001fbf0 0 SECTION LOCAL DEFAULT 16 17: 000000001001fbf8 0 SECTION LOCAL DEFAULT 17 18: 000000001001fc00 0 SECTION LOCAL DEFAULT 18 19: 000000001001fdd0 0 SECTION LOCAL DEFAULT 19 20: 000000001001fe88 0 SECTION LOCAL DEFAULT 20 21: 000000001001ff00 0 SECTION LOCAL DEFAULT 21 22: 0000000010020000 0 SECTION LOCAL DEFAULT 22 23: 0000000010020004 0 SECTION LOCAL DEFAULT 23 24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 26: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 27: 000000001001fe00 0 FUNC LOCAL DEFAULT 19 deregister_tm_clones 28: 000000001001fe10 0 FUNC LOCAL DEFAULT 19 register_tm_clones 29: 000000001001fe20 0 FUNC LOCAL DEFAULT 19 __do_global_dtors_aux 30: 0000000010020004 1 OBJECT LOCAL DEFAULT 23 completed.8892 31: 000000001001fbf8 0 OBJECT LOCAL DEFAULT 17 __do_global_dtors_aux_fini_array_entry 32: 000000001001fe30 0 FUNC LOCAL DEFAULT 19 frame_dummy 33: 000000001001fbf0 0 OBJECT LOCAL DEFAULT 16 __frame_dummy_init_array_entry 34: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 35: 0000000010000960 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 36: 0000000000000000 0 FILE LOCAL DEFAULT ABS 37: 00000000100004a8 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__libc_start_main@@GLIBC_2.3 38: 0000000010000490 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.snprintf@@GLIBC_2.4 39: 0000000010000460 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__printf_chk@@GLIBC_2.4 40: 00000000100007d8 0 NOTYPE LOCAL DEFAULT 11 __glink_PLTresolve 41: 0000000010000478 0 NOTYPE LOCAL DEFAULT 11 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 42: 000000001001fbf8 0 NOTYPE LOCAL DEFAULT 16 __init_array_end 43: 000000001001fc00 0 OBJECT LOCAL DEFAULT 18 _DYNAMIC 44: 000000001001fbf0 0 NOTYPE LOCAL DEFAULT 16 __init_array_start 45: 0000000010000898 0 NOTYPE LOCAL DEFAULT 14 __GNU_EH_FRAME_HDR 46: 000000001001fe70 16 FUNC GLOBAL DEFAULT 19 __libc_csu_fini 47: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.3 48: 0000000010020000 0 NOTYPE WEAK DEFAULT 22 data_start 49: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 22 _edata 50: 000000001001fdf0 0 FUNC GLOBAL DEFAULT 19 _fini 51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 52: 0000000010020000 0 NOTYPE GLOBAL DEFAULT 22 __data_start 53: 0000000010000878 0 OBJECT GLOBAL HIDDEN 13 __dso_handle 54: 000000001001fe40 140 FUNC GLOBAL DEFAULT 19 announcement 55: 0000000010000870 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 56: 000000001001fe60 204 FUNC GLOBAL DEFAULT 19 __libc_csu_init 57: 0000000000000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 58: 0000000010020008 0 NOTYPE GLOBAL DEFAULT 23 _end 59: 000000001001fdd0 60 FUNC GLOBAL DEFAULT 19 _start 60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 61: 0000000010020004 0 NOTYPE GLOBAL DEFAULT 23 __bss_start 62: 000000001001fe50 60 FUNC GLOBAL DEFAULT 19 main 63: 0000000010020008 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__ 64: 000000001001fde0 0 FUNC GLOBAL DEFAULT 19 _init # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x1001fe40) ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x1001fe40) # Check state of hardening features via check script perl ../build-tree/hardening-check -p ../build-tree/includes-test-linked ../build-tree/includes-test-linked: Position Independent Executable: no, normal executable! (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: yes Immediate binding: yes # Manually check state of hardening features # Skipped PIE test # Test Stack Protector nm ../build-tree/includes-test-linked | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000478 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 # Test Fortify nm ../build-tree/includes-test-linked | egrep '__(sn)?printf_chk($|@@GLIBC)' 0000000010000460 t 0000003c.plt_call.__printf_chk@@GLIBC_2.4 U __printf_chk@@GLIBC_2.4 # Test Format (no-op currently) # Test for RELRO readelf -lW ../build-tree/includes-test-linked | grep GNU_RELRO GNU_RELRO 0x00fbf0 0x000000001001fbf0 0x000000001001fbf0 0x000410 0x000410 R 0x1 # Test for BIND_NOW readelf -dW ../build-tree/includes-test-linked | grep BIND_NOW 0x0000000000000018 (BIND_NOW) # Build directly with -fPIC already defined cc -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-fPIC-direct hello.c ../build-tree/includes-test-fPIC-direct ../build-tree/includes-test-fPIC-direct: ok (0x1001fe40) # Build .o with -fPIC already defined cc -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-fPIC.o -c hello.c # Link .o with -fPIC already defined cc -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-fPIC ../build-tree/includes-test-fPIC.o ../build-tree/includes-test-fPIC ../build-tree/includes-test-fPIC: ok (0x1001fe40) # Make sure build fails due to -Werror=format-security ! cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-format-security format.c # Make sure build succeeds with -Wno-format-security cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wno-format-security -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-format-security format.c # Make sure build stack-protects a small ssp buffer cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-ssp-buffer-size-protect ssp-buffer-size-protect.c # Test Stack Protector nm ../build-tree/includes-test-ssp-buffer-size-protect | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000478 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 # Make sure build stack-protects a non-char array cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-ssp-buffer-type-protect ssp-buffer-type-protect.c # Test Stack Protector nm ../build-tree/includes-test-ssp-buffer-type-protect | egrep '__stack_chk_fail($|@@GLIBC)' 0000000010000438 t 0000003c.plt_call.__stack_chk_fail@@GLIBC_2.4 U __stack_chk_fail@@GLIBC_2.4 cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -c -o ../build-tree/includes-test-all.o hello.c ar r ../build-tree/includes-test-all.a ../build-tree/includes-test-all.o readelf -ldrsW ../build-tree/includes-test-all.a File: ../build-tree/includes-test-all.a(includes-test-all.o) There are no program headers in this file. Relocation section '.rela.text' at offset 0x328 contains 9 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000006 0000000700000032 R_PPC64_TOC16_HA 0000000000000000 .rodata.str1.8 + 0 000000000000000e 0000000700000030 R_PPC64_TOC16_LO 0000000000000000 .rodata.str1.8 + 0 000000000000002c 0000000b0000000a R_PPC64_REL24 0000000000000000 snprintf + 0 0000000000000036 0000000a00000032 R_PPC64_TOC16_HA 0000000000000000 announcement + 0 000000000000003a 0000000700000032 R_PPC64_TOC16_HA 0000000000000000 .rodata.str1.8 + 8 0000000000000042 0000000a00000030 R_PPC64_TOC16_LO 0000000000000000 announcement + 0 0000000000000046 0000000700000030 R_PPC64_TOC16_LO 0000000000000000 .rodata.str1.8 + 8 000000000000004c 0000000c0000000a R_PPC64_REL24 0000000000000000 __printf_chk + 0 0000000000000078 0000000d0000000a R_PPC64_REL24 0000000000000000 __stack_chk_fail + 0 Relocation section '.rela.opd' at offset 0x400 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 0 0000000000000008 0000000000000033 R_PPC64_TOC 0 0000000000000010 0000000600000026 R_PPC64_ADDR64 0000000000000000 .text.startup + 0 0000000000000018 0000000000000033 R_PPC64_TOC 0 Relocation section '.rela.text.startup' at offset 0x460 contains 1 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000010 0000000a0000000a R_PPC64_REL24 0000000000000000 announcement + 0 Symbol table '.symtab' contains 15 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 0000000000000000 0 SECTION LOCAL DEFAULT 1 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 4: 0000000000000000 0 SECTION LOCAL DEFAULT 4 5: 0000000000000000 0 SECTION LOCAL DEFAULT 5 6: 0000000000000000 0 SECTION LOCAL DEFAULT 7 7: 0000000000000000 0 SECTION LOCAL DEFAULT 9 8: 0000000000000000 0 SECTION LOCAL DEFAULT 11 9: 0000000000000000 0 SECTION LOCAL DEFAULT 10 10: 0000000000000000 140 FUNC GLOBAL DEFAULT 5 announcement 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 12: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 13: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail 14: 0000000000000010 60 FUNC GLOBAL DEFAULT 5 main perl ../build-tree/hardening-check -p ../build-tree/includes-test-all.a ../build-tree/includes-test-all.a: Position Independent Executable: no, object archive (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: no, non-ELF (ignored) Immediate binding: no, non-ELF (ignored) DEB_BUILD_HARDENING=0 cc -c -o ../build-tree/includes-test-none.o hello.c ar r ../build-tree/includes-test-none.a ../build-tree/includes-test-none.o readelf -ldrsW ../build-tree/includes-test-none.a File: ../build-tree/includes-test-none.a(includes-test-none.o) There are no program headers in this file. Relocation section '.rela.text' at offset 0x300 contains 9 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001e 0000000500000032 R_PPC64_TOC16_HA 0000000000000000 .rodata + 0 0000000000000022 0000000500000030 R_PPC64_TOC16_LO 0000000000000000 .rodata + 0 0000000000000030 0000000a0000000a R_PPC64_REL24 0000000000000000 snprintf + 0 000000000000003a 0000000900000032 R_PPC64_TOC16_HA 0000000000000000 announcement + 0 000000000000003e 0000000900000030 R_PPC64_TOC16_LO 0000000000000000 announcement + 0 000000000000004a 0000000500000032 R_PPC64_TOC16_HA 0000000000000000 .rodata + 8 000000000000004e 0000000500000030 R_PPC64_TOC16_LO 0000000000000000 .rodata + 8 0000000000000050 0000000b0000000a R_PPC64_REL24 0000000000000000 printf + 0 00000000000000ac 000000090000000a R_PPC64_REL24 0000000000000000 announcement + 0 Relocation section '.rela.opd' at offset 0x3d8 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 0 0000000000000008 0000000000000033 R_PPC64_TOC 0 0000000000000010 0000000200000026 R_PPC64_ADDR64 0000000000000000 .text + 80 0000000000000018 0000000000000033 R_PPC64_TOC 0 Symbol table '.symtab' contains 13 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 0000000000000000 0 SECTION LOCAL DEFAULT 1 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 4: 0000000000000000 0 SECTION LOCAL DEFAULT 4 5: 0000000000000000 0 SECTION LOCAL DEFAULT 5 6: 0000000000000000 0 SECTION LOCAL DEFAULT 6 7: 0000000000000000 0 SECTION LOCAL DEFAULT 9 8: 0000000000000000 0 SECTION LOCAL DEFAULT 8 9: 0000000000000000 128 FUNC GLOBAL DEFAULT 6 announcement 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND printf 12: 0000000000000010 120 FUNC GLOBAL DEFAULT 6 main if perl ../build-tree/hardening-check -p ../build-tree/includes-test-none.a; then exit 1; fi ../build-tree/includes-test-none.a: Position Independent Executable: no, object archive (ignored) Stack protected: no, not found! Fortify Source functions: no, only unprotected functions found! Read-only relocations: no, non-ELF (ignored) Immediate binding: no, non-ELF (ignored) # Disable stack protector cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -fno-stack-protector -o ../build-tree/includes-disabled hello.c if perl ../build-tree/hardening-check -p ../build-tree/includes-disabled; then exit 1; fi ../build-tree/includes-disabled: Position Independent Executable: no, normal executable! (ignored) Stack protected: no, not found! Fortify Source functions: yes (some protected functions found) Read-only relocations: yes Immediate binding: yes # Disable fortify cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -U_FORTIFY_SOURCE -o ../build-tree/includes-disabled hello.c if perl ../build-tree/hardening-check -p ../build-tree/includes-disabled; then exit 1; fi ../build-tree/includes-disabled: Position Independent Executable: no, normal executable! (ignored) Stack protected: yes Fortify Source functions: no, only unprotected functions found! Read-only relocations: yes Immediate binding: yes # Disable relro cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -Wl,-z,norelro -o ../build-tree/includes-disabled hello.c if perl ../build-tree/hardening-check -p ../build-tree/includes-disabled; then exit 1; fi ../build-tree/includes-disabled: Position Independent Executable: no, normal executable! (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: no, not found! Immediate binding: yes # Disable bindnow cc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -Wl,-z,lazy -o ../build-tree/includes-disabled hello.c if perl ../build-tree/hardening-check -p ../build-tree/includes-disabled; then exit 1; fi ../build-tree/includes-disabled: Position Independent Executable: no, normal executable! (ignored) Stack protected: yes Fortify Source functions: yes (some protected functions found) Read-only relocations: yes Immediate binding: no, not found! # Disable everything cc \ -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 \ -Wl,-z,relro -Wl,-z,now \ -fno-stack-protector \ -U_FORTIFY_SOURCE \ -Wno-format-security \ -Wl,-z,norelro \ -Wl,-z,lazy \ -o ../build-tree/includes-disabled hello.c if perl ../build-tree/hardening-check -p ../build-tree/includes-disabled; then exit 1; fi ../build-tree/includes-disabled: Position Independent Executable: no, normal executable! (ignored) Stack protected: no, not found! Fortify Source functions: no, only unprotected functions found! Read-only relocations: no, not found! Immediate binding: no, not found! readelf -ldW ../build-tree/includes-disabled Elf file type is EXEC (Executable file) Entry point 0x10010a50 There are 8 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0001c0 0x0001c0 R E 0x8 INTERP 0x000200 0x0000000010000200 0x0000000010000200 0x000011 0x000011 R 0x1 [Requesting program interpreter: /lib64/ld64.so.1] LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x00088c 0x00088c R E 0x10000 LOAD 0x000890 0x0000000010010890 0x0000000010010890 0x0003fc 0x000400 RW 0x10000 DYNAMIC 0x0008a0 0x00000000100108a0 0x00000000100108a0 0x0001b0 0x0001b0 RW 0x8 NOTE 0x000214 0x0000000010000214 0x0000000010000214 0x000044 0x000044 R 0x4 GNU_EH_FRAME 0x0007c0 0x00000000100007c0 0x00000000100007c0 0x00002c 0x00002c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .text .fini .rodata .eh_frame_hdr .eh_frame 03 .init_array .fini_array .dynamic .opd .got .plt .data .bss 04 .dynamic 05 .note.ABI-tag .note.gnu.build-id 06 .eh_frame_hdr 07 Dynamic section at offset 0x8a0 contains 22 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x10010a60 0x000000000000000d (FINI) 0x10010a70 0x0000000000000019 (INIT_ARRAY) 0x10010890 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) 0x000000000000001a (FINI_ARRAY) 0x10010898 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x10000258 0x0000000000000005 (STRTAB) 0x100002d8 0x0000000000000006 (SYMTAB) 0x10000278 0x000000000000000a (STRSZ) 58 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000003 (PLTGOT) 0x10010c28 0x0000000000000002 (PLTRELSZ) 72 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x10000350 0x0000000070000000 (PPC64_GLINK) 0x10000720 0x000000006ffffffe (VERNEED) 0x10000320 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x10000312 0x0000000000000000 (NULL) 0x0 make[2]: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make: Leaving directory '/builddir/build/BUILD/hardening-wrapper-2.6/hardening-wrapper' Processing files: hardening-check-2.6-1.fc26.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.kpTdCB Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.Ldbk3f make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. ../build-tree/hardened-cc syntax OK ../build-tree/hardened-ld syntax OK ../build-tree/hardened-c++ syntax OK /usr/bin/gcc -B ../build-tree/ -o ../build-tree/wrapper-test-stock hello.c /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-compiled hello.c /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-linked hello.c /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccqufLH4.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-linked /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. /tmp/cc0WPWGr.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC-direct hello.c /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccDi8fmg.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-fPIC-direct /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. /tmp/ccnggZeD.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC.o -c hello.c /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC.o /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccZASnPc.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-fPIC /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. ../build-tree/wrapper-test-fPIC.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-format-security format.c format.c: In function 'main': format.c:11:5: error: format not a string literal and no format arguments [-Werror=format-security] return fprintf(stderr, argv[0]); ^~~~~~ cc1: some warnings being treated as errors /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -Wno-format-security -o ../build-tree/wrapper-test-format-security format.c /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccqcsvqz.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-format-security /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. /tmp/ccZRNgaW.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-size-protect ssp-buffer-size-protect.c /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPLzEKH.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-ssp-buffer-size-protect /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. /tmp/ccv0clr4.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-type-protect ssp-buffer-type-protect.c /usr/bin/ld -z relro -z now -plugin /usr/libexec/gcc/ppc64-redhat-linux/7/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/ppc64-redhat-linux/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccK5UR2N.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o ../build-tree/wrapper-test-ssp-buffer-type-protect /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/7/crtbegin.o -L../build-tree -L/usr/lib/gcc/ppc64-redhat-linux/7 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/7/../../.. /tmp/ccVnrgGa.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/ppc64-redhat-linux/7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/7/../../../../lib64/crtn.o /usr/bin/gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -c -o ../build-tree/wrapper-test-all.o hello.c ar: creating ../build-tree/wrapper-test-all.a /usr/bin/gcc -B ../build-tree/ -c -o ../build-tree/wrapper-test-none.o hello.c ar: creating ../build-tree/wrapper-test-none.a format.c: In function 'main': format.c:11:5: error: format not a string literal and no format arguments [-Werror=format-security] return fprintf(stderr, argv[0]); ^~~~~~ cc1: some warnings being treated as errors ar: creating ../build-tree/includes-test-all.a ar: creating ../build-tree/includes-test-none.a + exit 0 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + DOCDIR=/builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/doc/hardening-check + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/doc/hardening-check + cp -pr hardening-wrapper/TODO /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/doc/hardening-check + cp -pr hardening-wrapper/debian/README.Debian /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/doc/hardening-check + cp -pr hardening-wrapper/debian/changelog /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/doc/hardening-check + exit 0 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + LICENSEDIR=/builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/licenses/hardening-check + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/licenses/hardening-check + cp -pr hardening-wrapper/AUTHORS /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/licenses/hardening-check + cp -pr hardening-wrapper/debian/copyright /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64/usr/share/licenses/hardening-check + exit 0 Provides: hardening-check = 2.6-1.fc26 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/perl perl(Getopt::Long) perl(IPC::Open3) perl(Pod::Usage) perl(Symbol) perl(Term::ANSIColor) perl(strict) perl(warnings) Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 Wrote: /builddir/build/RPMS/hardening-check-2.6-1.fc26.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.BXERxU + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/rm -rf /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.fc26.ppc64 + exit 0 Child return code was: 0