Mock Version: 1.2.17 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target armv7hl --nodeps /builddir/build/SPECS/hardening-wrapper.spec'], chrootPath='/var/lib/mock/epel-1-armhfp-bea99cd1643c36abcdead5a9c7a058751ec9e39e/root'shell=FalseprintOutput=Falseenv={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=0logger=uid=995) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target armv7hl --nodeps /builddir/build/SPECS/hardening-wrapper.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False Building target platforms: armv7hl Building for target armv7hl Wrote: /builddir/build/SRPMS/hardening-wrapper-2.6-1.el7.src.rpm Child return code was: 0 ENTER ['do'](['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target armv7hl --nodeps /builddir/build/SPECS/hardening-wrapper.spec'], chrootPath='/var/lib/mock/epel-1-armhfp-bea99cd1643c36abcdead5a9c7a058751ec9e39e/root'shell=Falseuid=995env={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=0private_network=Truelogger=printOutput=False) Executing command: ['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target armv7hl --nodeps /builddir/build/SPECS/hardening-wrapper.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False Building target platforms: armv7hl Building for target armv7hl Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.YHssT8 + 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 -xf - + 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.Uf3YQd + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/make -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' + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.H1ghJN + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm '!=' / ']' + rm -rf /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm ++ dirname /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm + cd hardening-wrapper-2.6 + /usr/bin/install -Dpm 0755 hardening-wrapper/build-tree/hardening-check /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/bin/hardening-check + /usr/bin/install -Dpm 0644 hardening-wrapper/build-tree/hardening-check.1 /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/man/man1/hardening-check.1 + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.oyghmR + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/make -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]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. # 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 (0x105f8) cc -Wall -fstack-protector-strong hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x105f8) cc -Wall -fPIE -pie hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x7f5bc7f4) ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x7f58b7f4) 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 ../build-tree/hardened-cc syntax OK ../build-tree/hardened-ld syntax OK ../build-tree/hardened-c++ syntax OK 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 /usr/bin/gcc -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 0x10420 There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000688 0x00010688 0x00010688 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x006ac 0x006ac R E 0x10000 LOAD 0x000f04 0x00020f04 0x00020f04 0x00124 0x00128 RW 0x10000 DYNAMIC 0x000f10 0x00020f10 0x00020f10 0x000f0 0x000f0 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000f04 0x00020f04 0x00020f04 0x000fc 0x000fc R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic Dynamic section at offset 0xf10 contains 25 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x103c4 0x0000000d (FINI) 0x10664 0x00000019 (INIT_ARRAY) 0x20f04 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20f08 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x10284 0x00000006 (SYMTAB) 0x101e4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x21000 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x1039c 0x00000011 (REL) 0x10394 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x10354 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x10340 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x394 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00021020 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ Relocation section '.rel.plt' at offset 0x39c contains 5 entries: Offset Info Type Sym. Value Symbol's Name 0002100c 00000616 R_ARM_JUMP_SLOT 00000000 printf 00021010 00000916 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00021014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00021018 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 0002101c 00000816 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 8: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (3) 9: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (3) Symbol table '.symtab' contains 108 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101e4 0 SECTION LOCAL DEFAULT 5 6: 00010284 0 SECTION LOCAL DEFAULT 6 7: 00010340 0 SECTION LOCAL DEFAULT 7 8: 00010354 0 SECTION LOCAL DEFAULT 8 9: 00010394 0 SECTION LOCAL DEFAULT 9 10: 0001039c 0 SECTION LOCAL DEFAULT 10 11: 000103c4 0 SECTION LOCAL DEFAULT 11 12: 000103d0 0 SECTION LOCAL DEFAULT 12 13: 00010420 0 SECTION LOCAL DEFAULT 13 14: 00010664 0 SECTION LOCAL DEFAULT 14 15: 0001066c 0 SECTION LOCAL DEFAULT 15 16: 00010688 0 SECTION LOCAL DEFAULT 16 17: 000106a8 0 SECTION LOCAL DEFAULT 17 18: 00020f04 0 SECTION LOCAL DEFAULT 18 19: 00020f08 0 SECTION LOCAL DEFAULT 19 20: 00020f0c 0 SECTION LOCAL DEFAULT 20 21: 00020f10 0 SECTION LOCAL DEFAULT 21 22: 00021000 0 SECTION LOCAL DEFAULT 22 23: 00021024 0 SECTION LOCAL DEFAULT 23 24: 00021028 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 00010420 0 NOTYPE LOCAL DEFAULT 13 $a 30: 00010688 0 NOTYPE LOCAL DEFAULT 16 $d 31: 00010450 0 NOTYPE LOCAL DEFAULT 13 $d 32: 0001066c 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021024 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 0001045c 0 NOTYPE LOCAL DEFAULT 13 $a 36: 0001045c 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010478 0 NOTYPE LOCAL DEFAULT 13 $d 38: 000103c4 0 NOTYPE LOCAL DEFAULT 11 $a 39: 00010664 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 000103cc 0 NOTYPE LOCAL DEFAULT 11 $a 42: 00010668 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 44: 00020f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 45: 00010480 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010480 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 47: 000104b4 0 NOTYPE LOCAL DEFAULT 13 $d 48: 000104b8 0 NOTYPE LOCAL DEFAULT 13 $a 49: 000104b8 0 FUNC LOCAL DEFAULT 13 register_tm_clones 50: 00010670 0 NOTYPE LOCAL DEFAULT 15 $d 51: 000104f8 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 52: 00021028 1 OBJECT LOCAL DEFAULT 24 completed.8853 53: 00020f08 0 NOTYPE LOCAL DEFAULT 19 $d 54: 00020f08 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 55: 00010520 0 FUNC LOCAL DEFAULT 13 frame_dummy 56: 00020f04 0 NOTYPE LOCAL DEFAULT 18 $d 57: 00020f04 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 58: 00021028 0 NOTYPE LOCAL DEFAULT 24 $d 59: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 60: 00010674 0 NOTYPE LOCAL DEFAULT 15 $d 61: 00010554 0 NOTYPE LOCAL DEFAULT 13 $a 62: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 63: 000105fc 0 NOTYPE LOCAL DEFAULT 13 $a 64: 00010658 0 NOTYPE LOCAL DEFAULT 13 $d 65: 00010690 0 NOTYPE LOCAL DEFAULT 16 $d 66: 00010660 0 NOTYPE LOCAL DEFAULT 13 $a 67: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 68: 000106a8 0 NOTYPE LOCAL DEFAULT 17 $d 69: 000106a8 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 70: 00020f0c 0 NOTYPE LOCAL DEFAULT 20 $d 71: 00020f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 72: 00000000 0 FILE LOCAL DEFAULT ABS 73: 00020f08 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 74: 00020f10 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 75: 00020f04 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 76: 00021000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 77: 000103d0 0 NOTYPE LOCAL DEFAULT 12 $a 78: 000103e0 0 NOTYPE LOCAL DEFAULT 12 $d 79: 000103e4 0 NOTYPE LOCAL DEFAULT 12 $a 80: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 81: 00010660 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 83: 00021024 0 NOTYPE WEAK DEFAULT 23 data_start 84: 00000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 85: 00021028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 87: 00021028 0 NOTYPE GLOBAL DEFAULT 23 _edata 88: 00010664 0 FUNC GLOBAL DEFAULT 14 _fini 89: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 90: 00021024 0 NOTYPE GLOBAL DEFAULT 23 __data_start 91: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 92: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 93: 00010670 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 94: 00010554 100 FUNC GLOBAL DEFAULT 13 announcement 95: 0001066c 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 96: 000105fc 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 97: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 98: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 _end 99: 00010420 0 FUNC GLOBAL DEFAULT 13 _start 100: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __end__ 101: 00021028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 102: 000105b8 68 FUNC GLOBAL DEFAULT 13 main 103: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 104: 00021028 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 105: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 106: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 107: 000103c4 0 FUNC GLOBAL DEFAULT 11 _init ../build-tree/wrapper-test-stock ../build-tree/wrapper-test-stock: ok (0x10554) # Compiler options enabled. (linker is not wrapper) ../build-tree/hardened-cc -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-compiled hello.c readelf -ldrsW ../build-tree/wrapper-test-compiled Elf file type is EXEC (Executable file) Entry point 0x104ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0001071c 0x0001071c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x00740 0x00740 R E 0x10000 LOAD 0x000efc 0x00020efc 0x00020efc 0x00130 0x0013c RW 0x10000 DYNAMIC 0x000f08 0x00020f08 0x00020f08 0x000f8 0x000f8 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000efc 0x00020efc 0x00020efc 0x00104 0x00104 R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic Dynamic section at offset 0xf08 contains 26 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x10468 0x0000000d (FINI) 0x106f8 0x00000019 (INIT_ARRAY) 0x20efc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20f00 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x102b0 0x00000006 (SYMTAB) 0x101f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x21000 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x10438 0x00000011 (REL) 0x10428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x103c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x103b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00021024 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00021030 00000614 R_ARM_COPY 00021030 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 0002100c 00000a16 R_ARM_JUMP_SLOT 00000000 __stack_chk_fail 00021010 00000b16 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00021014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00021018 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 0002101c 00000816 R_ARM_JUMP_SLOT 00000000 __printf_chk 00021020 00000916 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 12 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00021030 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (4) Symbol table '.symtab' contains 111 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101f0 0 SECTION LOCAL DEFAULT 5 6: 000102b0 0 SECTION LOCAL DEFAULT 6 7: 000103b0 0 SECTION LOCAL DEFAULT 7 8: 000103c8 0 SECTION LOCAL DEFAULT 8 9: 00010428 0 SECTION LOCAL DEFAULT 9 10: 00010438 0 SECTION LOCAL DEFAULT 10 11: 00010468 0 SECTION LOCAL DEFAULT 11 12: 00010474 0 SECTION LOCAL DEFAULT 12 13: 000104d0 0 SECTION LOCAL DEFAULT 13 14: 000106f8 0 SECTION LOCAL DEFAULT 14 15: 00010700 0 SECTION LOCAL DEFAULT 15 16: 0001071c 0 SECTION LOCAL DEFAULT 16 17: 0001073c 0 SECTION LOCAL DEFAULT 17 18: 00020efc 0 SECTION LOCAL DEFAULT 18 19: 00020f00 0 SECTION LOCAL DEFAULT 19 20: 00020f04 0 SECTION LOCAL DEFAULT 20 21: 00020f08 0 SECTION LOCAL DEFAULT 21 22: 00021000 0 SECTION LOCAL DEFAULT 22 23: 00021028 0 SECTION LOCAL DEFAULT 23 24: 00021030 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000104ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0001071c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0001051c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00010700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021028 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 00010528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00010528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00010468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000106f8 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 00010470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000106fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00010620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000104d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00020f04 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0001054c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0001054c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00010580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00010584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00010584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00010704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000105c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 00021034 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00020f00 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00020f00 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000105ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00020efc 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00020efc 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 00021034 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00010690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000106ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00010724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000106f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0001073c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0001073c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00020f04 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00020f04 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00020f00 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00020f08 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00020efc 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00021000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00010474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00010484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00010488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000106f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00021028 0 NOTYPE WEAK DEFAULT 23 data_start 85: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00021030 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00021038 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 0002102c 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000106f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00021038 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00021028 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00010704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00010620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00010700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00010690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00021038 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000104ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00021038 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000104d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 0002102c 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00010468 0 FUNC GLOBAL DEFAULT 11 _init # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x10620) ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x10620) # 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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-linked /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. /tmp/ccspH01c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o readelf -ldrsW ../build-tree/wrapper-test-linked Elf file type is EXEC (Executable file) Entry point 0x104ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0001071c 0x0001071c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x00740 0x00740 R E 0x10000 LOAD 0x000ec4 0x00020ec4 0x00020ec4 0x00140 0x0014c RW 0x10000 DYNAMIC 0x000ed0 0x00020ed0 0x00020ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00020ec4 0x00020ec4 0x0013c 0x0013c R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic .got Dynamic section at offset 0xed0 contains 28 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x10468 0x0000000d (FINI) 0x106f8 0x00000019 (INIT_ARRAY) 0x20ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x102b0 0x00000006 (SYMTAB) 0x101f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x20fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x10438 0x00000011 (REL) 0x10428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x103c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x103b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00020ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00021008 00000614 R_ARM_COPY 00021008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00020fe4 00000a16 R_ARM_JUMP_SLOT 00000000 __stack_chk_fail 00020fe8 00000b16 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00020fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00020ff0 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 00020ff4 00000816 R_ARM_JUMP_SLOT 00000000 __printf_chk 00020ff8 00000916 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 12 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (4) Symbol table '.symtab' contains 111 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101f0 0 SECTION LOCAL DEFAULT 5 6: 000102b0 0 SECTION LOCAL DEFAULT 6 7: 000103b0 0 SECTION LOCAL DEFAULT 7 8: 000103c8 0 SECTION LOCAL DEFAULT 8 9: 00010428 0 SECTION LOCAL DEFAULT 9 10: 00010438 0 SECTION LOCAL DEFAULT 10 11: 00010468 0 SECTION LOCAL DEFAULT 11 12: 00010474 0 SECTION LOCAL DEFAULT 12 13: 000104d0 0 SECTION LOCAL DEFAULT 13 14: 000106f8 0 SECTION LOCAL DEFAULT 14 15: 00010700 0 SECTION LOCAL DEFAULT 15 16: 0001071c 0 SECTION LOCAL DEFAULT 16 17: 0001073c 0 SECTION LOCAL DEFAULT 17 18: 00020ec4 0 SECTION LOCAL DEFAULT 18 19: 00020ec8 0 SECTION LOCAL DEFAULT 19 20: 00020ecc 0 SECTION LOCAL DEFAULT 20 21: 00020ed0 0 SECTION LOCAL DEFAULT 21 22: 00020fd8 0 SECTION LOCAL DEFAULT 22 23: 00021000 0 SECTION LOCAL DEFAULT 23 24: 00021008 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000104ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0001071c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0001051c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00010700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021000 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 00010528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00010528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00010468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000106f8 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 00010470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000106fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00010620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000104d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0001054c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0001054c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00010580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00010584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00010584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00010704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000105c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0002100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00020ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00020ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000105ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00020ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0002100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00010690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000106ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00010724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000106f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0001073c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0001073c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00020ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00020ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00020ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00020fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00010474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00010484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00010488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000106f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00021000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00021004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000106f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00021000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00010704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00010620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00010700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00010690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000104ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000104d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00021004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00010468 0 FUNC GLOBAL DEFAULT 11 _init # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x10620) ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x10620) # 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)' U __stack_chk_fail@@GLIBC_2.4 # Test Fortify nm ../build-tree/wrapper-test-linked | egrep '__(sn)?printf_chk($|@@GLIBC)' 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 0x000ec4 0x00020ec4 0x00020ec4 0x0013c 0x0013c R 0x1 # Test for BIND_NOW readelf -dW ../build-tree/wrapper-test-linked | grep BIND_NOW 0x00000018 (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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-fPIC-direct /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. /tmp/ccO63LIB.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o ../build-tree/wrapper-test-fPIC-direct ../build-tree/wrapper-test-fPIC-direct: ok (0x10640) # 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 /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 # 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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-fPIC /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. ../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/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC: ok (0x10640) # 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 /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 # 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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-format-security /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. /tmp/ccIlYTdb.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o # 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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-ssp-buffer-size-protect /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. /tmp/ccgGIySM.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o # Test Stack Protector nm ../build-tree/wrapper-test-ssp-buffer-size-protect | egrep '__stack_chk_fail($|@@GLIBC)' 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 /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.bfd -z relro -z now --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o ../build-tree/wrapper-test-ssp-buffer-type-protect /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtbegin.o -L../build-tree -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5 -L/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../.. /tmp/cc9EqLuC.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/crtend.o /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o # Test Stack Protector nm ../build-tree/wrapper-test-ssp-buffer-type-protect | egrep '__stack_chk_fail($|@@GLIBC)' 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 /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 r ../build-tree/wrapper-test-all.a ../build-tree/wrapper-test-all.o ar: creating ../build-tree/wrapper-test-all.a 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 '.rel.text' at offset 0x368 contains 11 entries: Offset Info Type Sym. Value Symbol's Name 00000004 0000102b R_ARM_MOVW_ABS_NC 00000000 __stack_chk_guard 00000008 0000102c R_ARM_MOVT_ABS 00000000 __stack_chk_guard 00000020 0000062b R_ARM_MOVW_ABS_NC 00000000 .LC0 00000028 0000062c R_ARM_MOVT_ABS 00000000 .LC0 00000030 0000111c R_ARM_CALL 00000000 snprintf 00000038 0000072b R_ARM_MOVW_ABS_NC 00000004 .LC1 0000003c 00000f2b R_ARM_MOVW_ABS_NC 00000000 announcement 00000040 0000072c R_ARM_MOVT_ABS 00000004 .LC1 00000044 00000f2c R_ARM_MOVT_ABS 00000000 announcement 0000004c 0000121c R_ARM_CALL 00000000 __printf_chk 0000006c 0000131c R_ARM_CALL 00000000 __stack_chk_fail Relocation section '.rel.text.startup' at offset 0x3c0 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00000008 00000f1c R_ARM_CALL 00000000 announcement Symbol table '.symtab' contains 21 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 NOTYPE LOCAL DEFAULT 1 $a 6: 00000000 0 NOTYPE LOCAL DEFAULT 7 .LC0 7: 00000004 0 NOTYPE LOCAL DEFAULT 7 .LC1 8: 00000000 0 SECTION LOCAL DEFAULT 5 9: 00000000 0 NOTYPE LOCAL DEFAULT 5 $a 10: 00000000 0 SECTION LOCAL DEFAULT 7 11: 00000000 0 NOTYPE LOCAL DEFAULT 7 $d 12: 00000000 0 SECTION LOCAL DEFAULT 9 13: 00000000 0 SECTION LOCAL DEFAULT 8 14: 00000000 0 SECTION LOCAL DEFAULT 10 15: 00000000 112 FUNC GLOBAL DEFAULT 1 announcement 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_guard 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 18: 00000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 19: 00000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail 20: 00000000 28 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 /usr/bin/gcc -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 ar: creating ../build-tree/wrapper-test-none.a 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 '.rel.text' at offset 0x300 contains 9 entries: Offset Info Type Sym. Value Symbol's Name 00000024 0000072b R_ARM_MOVW_ABS_NC 00000000 .LC0 00000028 0000072c R_ARM_MOVT_ABS 00000000 .LC0 00000030 00000e1c R_ARM_CALL 00000000 snprintf 0000003c 0000082b R_ARM_MOVW_ABS_NC 00000004 .LC1 00000040 0000082c R_ARM_MOVT_ABS 00000004 .LC1 00000048 00000d2b R_ARM_MOVW_ABS_NC 00000000 announcement 0000004c 00000d2c R_ARM_MOVT_ABS 00000000 announcement 00000050 00000f1c R_ARM_CALL 00000000 printf 00000084 00000d1c R_ARM_CALL 00000000 announcement Symbol table '.symtab' contains 17 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 SECTION LOCAL DEFAULT 5 6: 00000000 0 NOTYPE LOCAL DEFAULT 5 $d 7: 00000000 0 NOTYPE LOCAL DEFAULT 5 .LC0 8: 00000004 0 NOTYPE LOCAL DEFAULT 5 .LC1 9: 00000000 0 NOTYPE LOCAL DEFAULT 1 $a 10: 00000000 0 SECTION LOCAL DEFAULT 7 11: 00000000 0 SECTION LOCAL DEFAULT 6 12: 00000000 0 SECTION LOCAL DEFAULT 8 13: 00000000 100 FUNC GLOBAL DEFAULT 1 announcement 14: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 15: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf 16: 00000064 68 FUNC GLOBAL DEFAULT 1 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 0x10420 There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000688 0x00010688 0x00010688 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x006ac 0x006ac R E 0x10000 LOAD 0x000f04 0x00020f04 0x00020f04 0x00124 0x00128 RW 0x10000 DYNAMIC 0x000f10 0x00020f10 0x00020f10 0x000f0 0x000f0 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000f04 0x00020f04 0x00020f04 0x000fc 0x000fc R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic Dynamic section at offset 0xf10 contains 25 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x103c4 0x0000000d (FINI) 0x10664 0x00000019 (INIT_ARRAY) 0x20f04 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20f08 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x10284 0x00000006 (SYMTAB) 0x101e4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x21000 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x1039c 0x00000011 (REL) 0x10394 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x10354 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x10340 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x394 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00021020 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ Relocation section '.rel.plt' at offset 0x39c contains 5 entries: Offset Info Type Sym. Value Symbol's Name 0002100c 00000616 R_ARM_JUMP_SLOT 00000000 printf 00021010 00000916 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00021014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00021018 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 0002101c 00000816 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 8: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (3) 9: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (3) Symbol table '.symtab' contains 108 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101e4 0 SECTION LOCAL DEFAULT 5 6: 00010284 0 SECTION LOCAL DEFAULT 6 7: 00010340 0 SECTION LOCAL DEFAULT 7 8: 00010354 0 SECTION LOCAL DEFAULT 8 9: 00010394 0 SECTION LOCAL DEFAULT 9 10: 0001039c 0 SECTION LOCAL DEFAULT 10 11: 000103c4 0 SECTION LOCAL DEFAULT 11 12: 000103d0 0 SECTION LOCAL DEFAULT 12 13: 00010420 0 SECTION LOCAL DEFAULT 13 14: 00010664 0 SECTION LOCAL DEFAULT 14 15: 0001066c 0 SECTION LOCAL DEFAULT 15 16: 00010688 0 SECTION LOCAL DEFAULT 16 17: 000106a8 0 SECTION LOCAL DEFAULT 17 18: 00020f04 0 SECTION LOCAL DEFAULT 18 19: 00020f08 0 SECTION LOCAL DEFAULT 19 20: 00020f0c 0 SECTION LOCAL DEFAULT 20 21: 00020f10 0 SECTION LOCAL DEFAULT 21 22: 00021000 0 SECTION LOCAL DEFAULT 22 23: 00021024 0 SECTION LOCAL DEFAULT 23 24: 00021028 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 00010420 0 NOTYPE LOCAL DEFAULT 13 $a 30: 00010688 0 NOTYPE LOCAL DEFAULT 16 $d 31: 00010450 0 NOTYPE LOCAL DEFAULT 13 $d 32: 0001066c 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021024 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 0001045c 0 NOTYPE LOCAL DEFAULT 13 $a 36: 0001045c 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010478 0 NOTYPE LOCAL DEFAULT 13 $d 38: 000103c4 0 NOTYPE LOCAL DEFAULT 11 $a 39: 00010664 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 000103cc 0 NOTYPE LOCAL DEFAULT 11 $a 42: 00010668 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 44: 00020f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 45: 00010480 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010480 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 47: 000104b4 0 NOTYPE LOCAL DEFAULT 13 $d 48: 000104b8 0 NOTYPE LOCAL DEFAULT 13 $a 49: 000104b8 0 FUNC LOCAL DEFAULT 13 register_tm_clones 50: 00010670 0 NOTYPE LOCAL DEFAULT 15 $d 51: 000104f8 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 52: 00021028 1 OBJECT LOCAL DEFAULT 24 completed.8853 53: 00020f08 0 NOTYPE LOCAL DEFAULT 19 $d 54: 00020f08 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 55: 00010520 0 FUNC LOCAL DEFAULT 13 frame_dummy 56: 00020f04 0 NOTYPE LOCAL DEFAULT 18 $d 57: 00020f04 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 58: 00021028 0 NOTYPE LOCAL DEFAULT 24 $d 59: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 60: 00010674 0 NOTYPE LOCAL DEFAULT 15 $d 61: 00010554 0 NOTYPE LOCAL DEFAULT 13 $a 62: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 63: 000105fc 0 NOTYPE LOCAL DEFAULT 13 $a 64: 00010658 0 NOTYPE LOCAL DEFAULT 13 $d 65: 00010690 0 NOTYPE LOCAL DEFAULT 16 $d 66: 00010660 0 NOTYPE LOCAL DEFAULT 13 $a 67: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 68: 000106a8 0 NOTYPE LOCAL DEFAULT 17 $d 69: 000106a8 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 70: 00020f0c 0 NOTYPE LOCAL DEFAULT 20 $d 71: 00020f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 72: 00000000 0 FILE LOCAL DEFAULT ABS 73: 00020f08 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 74: 00020f10 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 75: 00020f04 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 76: 00021000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 77: 000103d0 0 NOTYPE LOCAL DEFAULT 12 $a 78: 000103e0 0 NOTYPE LOCAL DEFAULT 12 $d 79: 000103e4 0 NOTYPE LOCAL DEFAULT 12 $a 80: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 81: 00010660 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 83: 00021024 0 NOTYPE WEAK DEFAULT 23 data_start 84: 00000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 85: 00021028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 87: 00021028 0 NOTYPE GLOBAL DEFAULT 23 _edata 88: 00010664 0 FUNC GLOBAL DEFAULT 14 _fini 89: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 90: 00021024 0 NOTYPE GLOBAL DEFAULT 23 __data_start 91: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 92: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 93: 00010670 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 94: 00010554 100 FUNC GLOBAL DEFAULT 13 announcement 95: 0001066c 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 96: 000105fc 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 97: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 98: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 _end 99: 00010420 0 FUNC GLOBAL DEFAULT 13 _start 100: 0002102c 0 NOTYPE GLOBAL DEFAULT 24 __end__ 101: 00021028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 102: 000105b8 68 FUNC GLOBAL DEFAULT 13 main 103: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 104: 00021028 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 105: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 106: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 107: 000103c4 0 FUNC GLOBAL DEFAULT 11 _init ../build-tree/includes-test-stock ../build-tree/includes-test-stock: ok (0x10554) # 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 0x104ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0001071c 0x0001071c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x00740 0x00740 R E 0x10000 LOAD 0x000ec4 0x00020ec4 0x00020ec4 0x00140 0x0014c RW 0x10000 DYNAMIC 0x000ed0 0x00020ed0 0x00020ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00020ec4 0x00020ec4 0x0013c 0x0013c R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic .got Dynamic section at offset 0xed0 contains 28 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x10468 0x0000000d (FINI) 0x106f8 0x00000019 (INIT_ARRAY) 0x20ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x102b0 0x00000006 (SYMTAB) 0x101f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x20fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x10438 0x00000011 (REL) 0x10428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x103c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x103b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00020ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00021008 00000614 R_ARM_COPY 00021008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00020fe4 00000a16 R_ARM_JUMP_SLOT 00000000 __stack_chk_fail 00020fe8 00000b16 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00020fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00020ff0 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 00020ff4 00000816 R_ARM_JUMP_SLOT 00000000 __printf_chk 00020ff8 00000916 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 12 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (4) Symbol table '.symtab' contains 111 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101f0 0 SECTION LOCAL DEFAULT 5 6: 000102b0 0 SECTION LOCAL DEFAULT 6 7: 000103b0 0 SECTION LOCAL DEFAULT 7 8: 000103c8 0 SECTION LOCAL DEFAULT 8 9: 00010428 0 SECTION LOCAL DEFAULT 9 10: 00010438 0 SECTION LOCAL DEFAULT 10 11: 00010468 0 SECTION LOCAL DEFAULT 11 12: 00010474 0 SECTION LOCAL DEFAULT 12 13: 000104d0 0 SECTION LOCAL DEFAULT 13 14: 000106f8 0 SECTION LOCAL DEFAULT 14 15: 00010700 0 SECTION LOCAL DEFAULT 15 16: 0001071c 0 SECTION LOCAL DEFAULT 16 17: 0001073c 0 SECTION LOCAL DEFAULT 17 18: 00020ec4 0 SECTION LOCAL DEFAULT 18 19: 00020ec8 0 SECTION LOCAL DEFAULT 19 20: 00020ecc 0 SECTION LOCAL DEFAULT 20 21: 00020ed0 0 SECTION LOCAL DEFAULT 21 22: 00020fd8 0 SECTION LOCAL DEFAULT 22 23: 00021000 0 SECTION LOCAL DEFAULT 23 24: 00021008 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000104ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0001071c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0001051c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00010700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021000 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 00010528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00010528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00010468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000106f8 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 00010470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000106fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00010620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000104d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0001054c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0001054c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00010580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00010584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00010584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00010704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000105c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0002100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00020ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00020ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000105ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00020ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0002100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00010690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000106ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00010724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000106f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0001073c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0001073c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00020ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00020ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00020ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00020fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00010474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00010484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00010488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000106f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00021000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00021004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000106f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00021000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00010704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00010620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00010700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00010690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000104ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000104d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00021004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00010468 0 FUNC GLOBAL DEFAULT 11 _init # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x10620) ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x10620) # 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 0x104ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0001071c 0x0001071c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00010154 0x00010154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x00740 0x00740 R E 0x10000 LOAD 0x000ec4 0x00020ec4 0x00020ec4 0x00140 0x0014c RW 0x10000 DYNAMIC 0x000ed0 0x00020ed0 0x00020ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00010170 0x00010170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00020ec4 0x00020ec4 0x0013c 0x0013c R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 08 .init_array .fini_array .jcr .dynamic .got Dynamic section at offset 0xed0 contains 28 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x10468 0x0000000d (FINI) 0x106f8 0x00000019 (INIT_ARRAY) 0x20ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x20ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x101b4 0x00000005 (STRTAB) 0x102b0 0x00000006 (SYMTAB) 0x101f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x20fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x10438 0x00000011 (REL) 0x10428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x103c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x103b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00020ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00021008 00000614 R_ARM_COPY 00021008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00020fe4 00000a16 R_ARM_JUMP_SLOT 00000000 __stack_chk_fail 00020fe8 00000b16 R_ARM_JUMP_SLOT 00000000 __libc_start_main 00020fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00020ff0 00000716 R_ARM_JUMP_SLOT 00000000 snprintf 00020ff4 00000816 R_ARM_JUMP_SLOT 00000000 __printf_chk 00020ff8 00000916 R_ARM_JUMP_SLOT 00000000 abort Symbol table '.dynsym' contains 12 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@GCC_3.5 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 4: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 5: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 6: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 00000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (4) Symbol table '.symtab' contains 111 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00010154 0 SECTION LOCAL DEFAULT 1 2: 00010170 0 SECTION LOCAL DEFAULT 2 3: 00010190 0 SECTION LOCAL DEFAULT 3 4: 000101b4 0 SECTION LOCAL DEFAULT 4 5: 000101f0 0 SECTION LOCAL DEFAULT 5 6: 000102b0 0 SECTION LOCAL DEFAULT 6 7: 000103b0 0 SECTION LOCAL DEFAULT 7 8: 000103c8 0 SECTION LOCAL DEFAULT 8 9: 00010428 0 SECTION LOCAL DEFAULT 9 10: 00010438 0 SECTION LOCAL DEFAULT 10 11: 00010468 0 SECTION LOCAL DEFAULT 11 12: 00010474 0 SECTION LOCAL DEFAULT 12 13: 000104d0 0 SECTION LOCAL DEFAULT 13 14: 000106f8 0 SECTION LOCAL DEFAULT 14 15: 00010700 0 SECTION LOCAL DEFAULT 15 16: 0001071c 0 SECTION LOCAL DEFAULT 16 17: 0001073c 0 SECTION LOCAL DEFAULT 17 18: 00020ec4 0 SECTION LOCAL DEFAULT 18 19: 00020ec8 0 SECTION LOCAL DEFAULT 19 20: 00020ecc 0 SECTION LOCAL DEFAULT 20 21: 00020ed0 0 SECTION LOCAL DEFAULT 21 22: 00020fd8 0 SECTION LOCAL DEFAULT 22 23: 00021000 0 SECTION LOCAL DEFAULT 23 24: 00021008 0 SECTION LOCAL DEFAULT 24 25: 00000000 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crt1.o 28: 00010170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000104ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0001071c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0001051c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00010700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00021000 0 NOTYPE LOCAL DEFAULT 23 $d 34: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crti.o 35: 00010528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00010528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00010544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00010468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000106f8 0 NOTYPE LOCAL DEFAULT 14 $a 40: 00000000 0 FILE LOCAL DEFAULT ABS /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.5/../../../crtn.o 41: 00010470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000106fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00010620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000104d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00010708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0001054c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0001054c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00010580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00010584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00010584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00010704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000105c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0002100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00020ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00020ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000105ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00020ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0002100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00010690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000106ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00010724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000106f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0001073c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0001073c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00020ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00020ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00020ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00020ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00020ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00020fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00010474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00010484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00010488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000106f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00021000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00021008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00021004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000106f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00021000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00010704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00010620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00010700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00010690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00021010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000104ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00021010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00021004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000104d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00021004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 00000000 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00010468 0 FUNC GLOBAL DEFAULT 11 _init # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x10620) ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x10620) # 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)' U __stack_chk_fail@@GLIBC_2.4 # Test Fortify nm ../build-tree/includes-test-linked | egrep '__(sn)?printf_chk($|@@GLIBC)' 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 0x000ec4 0x00020ec4 0x00020ec4 0x0013c 0x0013c R 0x1 # Test for BIND_NOW readelf -dW ../build-tree/includes-test-linked | grep BIND_NOW 0x00000018 (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 (0x10640) # 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 (0x10640) # 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 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 # 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)' 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)' 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 ar: creating ../build-tree/includes-test-all.a 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 '.rel.text' at offset 0x368 contains 11 entries: Offset Info Type Sym. Value Symbol's Name 00000004 0000102b R_ARM_MOVW_ABS_NC 00000000 __stack_chk_guard 00000008 0000102c R_ARM_MOVT_ABS 00000000 __stack_chk_guard 00000020 0000062b R_ARM_MOVW_ABS_NC 00000000 .LC0 00000028 0000062c R_ARM_MOVT_ABS 00000000 .LC0 00000030 0000111c R_ARM_CALL 00000000 snprintf 00000038 0000072b R_ARM_MOVW_ABS_NC 00000004 .LC1 0000003c 00000f2b R_ARM_MOVW_ABS_NC 00000000 announcement 00000040 0000072c R_ARM_MOVT_ABS 00000004 .LC1 00000044 00000f2c R_ARM_MOVT_ABS 00000000 announcement 0000004c 0000121c R_ARM_CALL 00000000 __printf_chk 0000006c 0000131c R_ARM_CALL 00000000 __stack_chk_fail Relocation section '.rel.text.startup' at offset 0x3c0 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00000008 00000f1c R_ARM_CALL 00000000 announcement Symbol table '.symtab' contains 21 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 NOTYPE LOCAL DEFAULT 1 $a 6: 00000000 0 NOTYPE LOCAL DEFAULT 7 .LC0 7: 00000004 0 NOTYPE LOCAL DEFAULT 7 .LC1 8: 00000000 0 SECTION LOCAL DEFAULT 5 9: 00000000 0 NOTYPE LOCAL DEFAULT 5 $a 10: 00000000 0 SECTION LOCAL DEFAULT 7 11: 00000000 0 NOTYPE LOCAL DEFAULT 7 $d 12: 00000000 0 SECTION LOCAL DEFAULT 9 13: 00000000 0 SECTION LOCAL DEFAULT 8 14: 00000000 0 SECTION LOCAL DEFAULT 10 15: 00000000 112 FUNC GLOBAL DEFAULT 1 announcement 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_guard 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 18: 00000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 19: 00000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail 20: 00000000 28 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 ar: creating ../build-tree/includes-test-none.a 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 '.rel.text' at offset 0x300 contains 9 entries: Offset Info Type Sym. Value Symbol's Name 00000024 0000072b R_ARM_MOVW_ABS_NC 00000000 .LC0 00000028 0000072c R_ARM_MOVT_ABS 00000000 .LC0 00000030 00000e1c R_ARM_CALL 00000000 snprintf 0000003c 0000082b R_ARM_MOVW_ABS_NC 00000004 .LC1 00000040 0000082c R_ARM_MOVT_ABS 00000004 .LC1 00000048 00000d2b R_ARM_MOVW_ABS_NC 00000000 announcement 0000004c 00000d2c R_ARM_MOVT_ABS 00000000 announcement 00000050 00000f1c R_ARM_CALL 00000000 printf 00000084 00000d1c R_ARM_CALL 00000000 announcement Symbol table '.symtab' contains 17 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 SECTION LOCAL DEFAULT 5 6: 00000000 0 NOTYPE LOCAL DEFAULT 5 $d 7: 00000000 0 NOTYPE LOCAL DEFAULT 5 .LC0 8: 00000004 0 NOTYPE LOCAL DEFAULT 5 .LC1 9: 00000000 0 NOTYPE LOCAL DEFAULT 1 $a 10: 00000000 0 SECTION LOCAL DEFAULT 7 11: 00000000 0 SECTION LOCAL DEFAULT 6 12: 00000000 0 SECTION LOCAL DEFAULT 8 13: 00000000 100 FUNC GLOBAL DEFAULT 1 announcement 14: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 15: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf 16: 00000064 68 FUNC GLOBAL DEFAULT 1 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 0x1041c There are 8 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000624 0x00010624 0x00010624 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00010034 0x00010034 0x00100 0x00100 R E 0x4 INTERP 0x000134 0x00010134 0x00010134 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00010000 0x00010000 0x00648 0x00648 R E 0x10000 LOAD 0x000648 0x00020648 0x00020648 0x00124 0x00128 RW 0x10000 DYNAMIC 0x000654 0x00020654 0x00020654 0x000f0 0x000f0 RW 0x4 NOTE 0x000150 0x00010150 0x00010150 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 02 .interp 03 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 04 .init_array .fini_array .jcr .dynamic .got .data .bss 05 .dynamic 06 .note.ABI-tag .note.gnu.build-id 07 Dynamic section at offset 0x654 contains 25 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x103a4 0x0000000d (FINI) 0x10600 0x00000019 (INIT_ARRAY) 0x20648 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x2064c 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x10194 0x00000005 (STRTAB) 0x10264 0x00000006 (SYMTAB) 0x101c4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x20744 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x1037c 0x00000011 (REL) 0x10374 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x10334 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x10320 0x00000000 (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.el7.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.kjOaS1 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.w4Z6Rg + exit 0 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + DOCDIR=/builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/doc/hardening-check-2.6 + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/doc/hardening-check-2.6 + cp -pr hardening-wrapper/TODO /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/doc/hardening-check-2.6 + cp -pr hardening-wrapper/debian/README.Debian /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/doc/hardening-check-2.6 + cp -pr hardening-wrapper/debian/changelog /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/doc/hardening-check-2.6 + exit 0 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + LICENSEDIR=/builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/licenses/hardening-check-2.6 + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/licenses/hardening-check-2.6 + cp -pr hardening-wrapper/AUTHORS /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/licenses/hardening-check-2.6 + cp -pr hardening-wrapper/debian/copyright /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm/usr/share/licenses/hardening-check-2.6 + exit 0 Provides: hardening-check = 2.6-1.el7 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.el7.arm Wrote: /builddir/build/RPMS/hardening-check-2.6-1.el7.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.SFOJdR + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper-2.6 + /usr/bin/rm -rf /builddir/build/BUILDROOT/hardening-wrapper-2.6-1.el7.arm + exit 0 Child return code was: 0