Mock Version: 1.2.13 ENTER do(['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/hardening-check.spec'], chrootPath='/var/lib/mock/epel-1-armhfp-900c0ef83f4a78aba580126e5196add02d17a707/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 noarch --nodeps /builddir/build/SPECS/hardening-check.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: noarch Building for target noarch Wrote: /builddir/build/SRPMS/hardening-check-2.5-1.el7.src.rpm Child return code was: 0 LEAVE do --> ENTER do(['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/hardening-check.spec '], chrootPath='/var/lib/mock/epel-1-armhfp-900c0ef83f4a78aba580126e5196add02d17a707/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', '/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/hardening-check.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: noarch Building for target noarch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.dsBxnL + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf hardening-wrapper + /usr/bin/gzip -dc /builddir/build/SOURCES/hardening-wrapper_2.5.tar.gz + /usr/bin/tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd hardening-wrapper + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + sed -i -e '/^[ \t]*if \[ -z \"\$.DEB_/d' Makefile + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Cxm9Vn + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper + make -j4 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 + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.nf2qNC + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch ++ dirname /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch + cd hardening-wrapper + mkdir -p /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/bin /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/man/man1 + install -pm 0755 build-tree/hardening-check /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/bin + install -pm 0644 build-tree/hardening-check.1 /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/man/man1 + /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 /builddir/build/BUILD/hardening-wrapper /usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match. + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /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.SqbqA7 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper + make check make -C tests check make[1]: Entering directory `/builddir/build/BUILD/hardening-wrapper/tests' # Check the stack protector and PIE options directly, just to have # a historical record in the build logs. cc -Wall -fstack-protector hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x85f8) cc -Wall -fPIE -pie hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x7f60b7f4) ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x7f5ec7f4) make -f Makefile.wrapper check make[2]: Entering directory `/builddir/build/BUILD/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 0x8420 There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000688 0x00008688 0x00008688 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x006ac 0x006ac R E 0x8000 LOAD 0x000f04 0x00010f04 0x00010f04 0x00124 0x00128 RW 0x8000 DYNAMIC 0x000f10 0x00010f10 0x00010f10 0x000f0 0x000f0 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000f04 0x00010f04 0x00010f04 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) 0x83c4 0x0000000d (FINI) 0x8664 0x00000019 (INIT_ARRAY) 0x10f04 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10f08 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x8284 0x00000006 (SYMTAB) 0x81e4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x11000 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x839c 0x00000011 (REL) 0x8394 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x8354 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x8340 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x394 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00011020 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 0001100c 00000616 R_ARM_JUMP_SLOT 000083e4 printf 00011010 00000916 R_ARM_JUMP_SLOT 000083f0 __libc_start_main 00011014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00011018 00000716 R_ARM_JUMP_SLOT 00008408 snprintf 0001101c 00000816 R_ARM_JUMP_SLOT 00008414 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: 000083e4 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 7: 00008408 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 8: 00008414 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (3) 9: 000083f0 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081e4 0 SECTION LOCAL DEFAULT 5 6: 00008284 0 SECTION LOCAL DEFAULT 6 7: 00008340 0 SECTION LOCAL DEFAULT 7 8: 00008354 0 SECTION LOCAL DEFAULT 8 9: 00008394 0 SECTION LOCAL DEFAULT 9 10: 0000839c 0 SECTION LOCAL DEFAULT 10 11: 000083c4 0 SECTION LOCAL DEFAULT 11 12: 000083d0 0 SECTION LOCAL DEFAULT 12 13: 00008420 0 SECTION LOCAL DEFAULT 13 14: 00008664 0 SECTION LOCAL DEFAULT 14 15: 0000866c 0 SECTION LOCAL DEFAULT 15 16: 00008688 0 SECTION LOCAL DEFAULT 16 17: 000086a8 0 SECTION LOCAL DEFAULT 17 18: 00010f04 0 SECTION LOCAL DEFAULT 18 19: 00010f08 0 SECTION LOCAL DEFAULT 19 20: 00010f0c 0 SECTION LOCAL DEFAULT 20 21: 00010f10 0 SECTION LOCAL DEFAULT 21 22: 00011000 0 SECTION LOCAL DEFAULT 22 23: 00011024 0 SECTION LOCAL DEFAULT 23 24: 00011028 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 00008420 0 NOTYPE LOCAL DEFAULT 13 $a 30: 00008688 0 NOTYPE LOCAL DEFAULT 16 $d 31: 00008450 0 NOTYPE LOCAL DEFAULT 13 $d 32: 0000866c 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011024 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: 0000845c 0 NOTYPE LOCAL DEFAULT 13 $a 36: 0000845c 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008478 0 NOTYPE LOCAL DEFAULT 13 $d 38: 000083c4 0 NOTYPE LOCAL DEFAULT 11 $a 39: 00008664 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: 000083cc 0 NOTYPE LOCAL DEFAULT 11 $a 42: 00008668 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 44: 00010f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 45: 00008480 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008480 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 47: 000084b4 0 NOTYPE LOCAL DEFAULT 13 $d 48: 000084b8 0 NOTYPE LOCAL DEFAULT 13 $a 49: 000084b8 0 FUNC LOCAL DEFAULT 13 register_tm_clones 50: 00008670 0 NOTYPE LOCAL DEFAULT 15 $d 51: 000084f8 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 52: 00011028 1 OBJECT LOCAL DEFAULT 24 completed.8853 53: 00010f08 0 NOTYPE LOCAL DEFAULT 19 $d 54: 00010f08 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 55: 00008520 0 FUNC LOCAL DEFAULT 13 frame_dummy 56: 00010f04 0 NOTYPE LOCAL DEFAULT 18 $d 57: 00010f04 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 58: 00011028 0 NOTYPE LOCAL DEFAULT 24 $d 59: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 60: 00008674 0 NOTYPE LOCAL DEFAULT 15 $d 61: 00008554 0 NOTYPE LOCAL DEFAULT 13 $a 62: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 63: 000085fc 0 NOTYPE LOCAL DEFAULT 13 $a 64: 00008658 0 NOTYPE LOCAL DEFAULT 13 $d 65: 00008690 0 NOTYPE LOCAL DEFAULT 16 $d 66: 00008660 0 NOTYPE LOCAL DEFAULT 13 $a 67: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 68: 000086a8 0 NOTYPE LOCAL DEFAULT 17 $d 69: 000086a8 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 70: 00010f0c 0 NOTYPE LOCAL DEFAULT 20 $d 71: 00010f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 72: 00000000 0 FILE LOCAL DEFAULT ABS 73: 00010f08 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 74: 00010f10 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 75: 00010f04 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 76: 00011000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 77: 000083d0 0 NOTYPE LOCAL DEFAULT 12 $a 78: 000083e0 0 NOTYPE LOCAL DEFAULT 12 $d 79: 000083e4 0 NOTYPE LOCAL DEFAULT 12 $a 80: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 81: 00008660 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 83: 00011024 0 NOTYPE WEAK DEFAULT 23 data_start 84: 000083e4 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 85: 00011028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 87: 00011028 0 NOTYPE GLOBAL DEFAULT 23 _edata 88: 00008664 0 FUNC GLOBAL DEFAULT 14 _fini 89: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 90: 00011024 0 NOTYPE GLOBAL DEFAULT 23 __data_start 91: 000083f0 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 92: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 93: 00008670 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 94: 00008554 100 FUNC GLOBAL DEFAULT 13 announcement 95: 0000866c 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 96: 000085fc 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 97: 00008408 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 98: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 _end 99: 00008420 0 FUNC GLOBAL DEFAULT 13 _start 100: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __end__ 101: 00011028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 102: 000085b8 68 FUNC GLOBAL DEFAULT 13 main 103: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 104: 00011028 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 105: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 106: 00008414 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 107: 000083c4 0 FUNC GLOBAL DEFAULT 11 _init ../build-tree/wrapper-test-stock ../build-tree/wrapper-test-stock: ok (0x8554) # 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 --param=ssp-buffer-size=4 -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 0x84ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0000871c 0x0000871c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x00740 0x00740 R E 0x8000 LOAD 0x000efc 0x00010efc 0x00010efc 0x00130 0x0013c RW 0x8000 DYNAMIC 0x000f08 0x00010f08 0x00010f08 0x000f8 0x000f8 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000efc 0x00010efc 0x00010efc 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) 0x8468 0x0000000d (FINI) 0x86f8 0x00000019 (INIT_ARRAY) 0x10efc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10f00 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x82b0 0x00000006 (SYMTAB) 0x81f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x11000 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x8438 0x00000011 (REL) 0x8428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x83c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x83b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00011024 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00011030 00000614 R_ARM_COPY 00011030 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 0001100c 00000a16 R_ARM_JUMP_SLOT 00008488 __stack_chk_fail 00011010 00000b16 R_ARM_JUMP_SLOT 00008494 __libc_start_main 00011014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00011018 00000716 R_ARM_JUMP_SLOT 000084ac snprintf 0001101c 00000816 R_ARM_JUMP_SLOT 000084b8 __printf_chk 00011020 00000916 R_ARM_JUMP_SLOT 000084c4 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: 00011030 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00008494 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081f0 0 SECTION LOCAL DEFAULT 5 6: 000082b0 0 SECTION LOCAL DEFAULT 6 7: 000083b0 0 SECTION LOCAL DEFAULT 7 8: 000083c8 0 SECTION LOCAL DEFAULT 8 9: 00008428 0 SECTION LOCAL DEFAULT 9 10: 00008438 0 SECTION LOCAL DEFAULT 10 11: 00008468 0 SECTION LOCAL DEFAULT 11 12: 00008474 0 SECTION LOCAL DEFAULT 12 13: 000084d0 0 SECTION LOCAL DEFAULT 13 14: 000086f8 0 SECTION LOCAL DEFAULT 14 15: 00008700 0 SECTION LOCAL DEFAULT 15 16: 0000871c 0 SECTION LOCAL DEFAULT 16 17: 0000873c 0 SECTION LOCAL DEFAULT 17 18: 00010efc 0 SECTION LOCAL DEFAULT 18 19: 00010f00 0 SECTION LOCAL DEFAULT 19 20: 00010f04 0 SECTION LOCAL DEFAULT 20 21: 00010f08 0 SECTION LOCAL DEFAULT 21 22: 00011000 0 SECTION LOCAL DEFAULT 22 23: 00011028 0 SECTION LOCAL DEFAULT 23 24: 00011030 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000084ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0000871c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0000851c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00008700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011028 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: 00008528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00008528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00008468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000086f8 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: 00008470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000086fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00008620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000084d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00010f04 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0000854c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0000854c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00008580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00008584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00008584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00008704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000085c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 00011034 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00010f00 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00010f00 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000085ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00010efc 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00010efc 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 00011034 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00008690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000086ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00008724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000086f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0000873c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0000873c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00010f04 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00010f04 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00010f00 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00010f08 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00010efc 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00011000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00008474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00008484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00008488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000086f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00011028 0 NOTYPE WEAK DEFAULT 23 data_start 85: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00011030 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00011038 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 0001102c 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000086f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00011038 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00011028 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00008494 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00008704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00008620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00008700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00008690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00011038 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000084ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00011038 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000084d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 0001102c 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00008468 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 (0x8620) ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x8620) # 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 --param=ssp-buffer-size=4 -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/cc0oQoa0.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 0x84ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0000871c 0x0000871c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x00740 0x00740 R E 0x8000 LOAD 0x000ec4 0x00010ec4 0x00010ec4 0x00140 0x0014c RW 0x8000 DYNAMIC 0x000ed0 0x00010ed0 0x00010ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00010ec4 0x00010ec4 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) 0x8468 0x0000000d (FINI) 0x86f8 0x00000019 (INIT_ARRAY) 0x10ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x82b0 0x00000006 (SYMTAB) 0x81f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x10fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x8438 0x00000011 (REL) 0x8428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x83c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x83b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00010ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00011008 00000614 R_ARM_COPY 00011008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00010fe4 00000a16 R_ARM_JUMP_SLOT 00008488 __stack_chk_fail 00010fe8 00000b16 R_ARM_JUMP_SLOT 00008494 __libc_start_main 00010fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00010ff0 00000716 R_ARM_JUMP_SLOT 000084ac snprintf 00010ff4 00000816 R_ARM_JUMP_SLOT 000084b8 __printf_chk 00010ff8 00000916 R_ARM_JUMP_SLOT 000084c4 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: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00008494 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081f0 0 SECTION LOCAL DEFAULT 5 6: 000082b0 0 SECTION LOCAL DEFAULT 6 7: 000083b0 0 SECTION LOCAL DEFAULT 7 8: 000083c8 0 SECTION LOCAL DEFAULT 8 9: 00008428 0 SECTION LOCAL DEFAULT 9 10: 00008438 0 SECTION LOCAL DEFAULT 10 11: 00008468 0 SECTION LOCAL DEFAULT 11 12: 00008474 0 SECTION LOCAL DEFAULT 12 13: 000084d0 0 SECTION LOCAL DEFAULT 13 14: 000086f8 0 SECTION LOCAL DEFAULT 14 15: 00008700 0 SECTION LOCAL DEFAULT 15 16: 0000871c 0 SECTION LOCAL DEFAULT 16 17: 0000873c 0 SECTION LOCAL DEFAULT 17 18: 00010ec4 0 SECTION LOCAL DEFAULT 18 19: 00010ec8 0 SECTION LOCAL DEFAULT 19 20: 00010ecc 0 SECTION LOCAL DEFAULT 20 21: 00010ed0 0 SECTION LOCAL DEFAULT 21 22: 00010fd8 0 SECTION LOCAL DEFAULT 22 23: 00011000 0 SECTION LOCAL DEFAULT 23 24: 00011008 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000084ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0000871c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0000851c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00008700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011000 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: 00008528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00008528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00008468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000086f8 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: 00008470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000086fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00008620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000084d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0000854c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0000854c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00008580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00008584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00008584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00008704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000085c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0001100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00010ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00010ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000085ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00010ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0001100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00008690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000086ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00008724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000086f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0000873c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0000873c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00010ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00010ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00010ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00010fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00008474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00008484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00008488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000086f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00011000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00011004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000086f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00011000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00008494 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00008704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00008620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00008700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00008690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000084ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000084d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00011004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00008468 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 (0x8620) ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x8620) # 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 0x00010ec4 0x00010ec4 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 --param=ssp-buffer-size=4 -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/cc45VMQW.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 (0x8640) # 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 --param=ssp-buffer-size=4 -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 --param=ssp-buffer-size=4 -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 (0x8640) # 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 --param=ssp-buffer-size=4 -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 --param=ssp-buffer-size=4 -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/ccUP9NoH.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 --param=ssp-buffer-size=4 -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/cc6gngRv.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 does not stack-protects a tiny ssp buffer ../build-tree/hardened-cc -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-size-skip ssp-buffer-size-skip.c /usr/bin/gcc -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-size-skip ssp-buffer-size-skip.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-skip /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/ccSxSUgL.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 is correctly skipped ! nm ../build-tree/wrapper-test-ssp-buffer-size-skip | egrep '__stack_chk_fail($|@@GLIBC)' ../build-tree/hardened-cc -B ../build-tree/ -O2 -c -o ../build-tree/wrapper-test-all.o hello.c /usr/bin/gcc -fstack-protector --param=ssp-buffer-size=4 -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 0x594 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 0x5ec 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 0x4e0 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/tests' make -f Makefile.includes check make[2]: Entering directory `/builddir/build/BUILD/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 0x8420 There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000688 0x00008688 0x00008688 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x006ac 0x006ac R E 0x8000 LOAD 0x000f04 0x00010f04 0x00010f04 0x00124 0x00128 RW 0x8000 DYNAMIC 0x000f10 0x00010f10 0x00010f10 0x000f0 0x000f0 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000f04 0x00010f04 0x00010f04 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) 0x83c4 0x0000000d (FINI) 0x8664 0x00000019 (INIT_ARRAY) 0x10f04 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10f08 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x8284 0x00000006 (SYMTAB) 0x81e4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x11000 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x839c 0x00000011 (REL) 0x8394 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x8354 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x8340 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x394 contains 1 entries: Offset Info Type Sym. Value Symbol's Name 00011020 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 0001100c 00000616 R_ARM_JUMP_SLOT 000083e4 printf 00011010 00000916 R_ARM_JUMP_SLOT 000083f0 __libc_start_main 00011014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00011018 00000716 R_ARM_JUMP_SLOT 00008408 snprintf 0001101c 00000816 R_ARM_JUMP_SLOT 00008414 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: 000083e4 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (3) 7: 00008408 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (3) 8: 00008414 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (3) 9: 000083f0 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081e4 0 SECTION LOCAL DEFAULT 5 6: 00008284 0 SECTION LOCAL DEFAULT 6 7: 00008340 0 SECTION LOCAL DEFAULT 7 8: 00008354 0 SECTION LOCAL DEFAULT 8 9: 00008394 0 SECTION LOCAL DEFAULT 9 10: 0000839c 0 SECTION LOCAL DEFAULT 10 11: 000083c4 0 SECTION LOCAL DEFAULT 11 12: 000083d0 0 SECTION LOCAL DEFAULT 12 13: 00008420 0 SECTION LOCAL DEFAULT 13 14: 00008664 0 SECTION LOCAL DEFAULT 14 15: 0000866c 0 SECTION LOCAL DEFAULT 15 16: 00008688 0 SECTION LOCAL DEFAULT 16 17: 000086a8 0 SECTION LOCAL DEFAULT 17 18: 00010f04 0 SECTION LOCAL DEFAULT 18 19: 00010f08 0 SECTION LOCAL DEFAULT 19 20: 00010f0c 0 SECTION LOCAL DEFAULT 20 21: 00010f10 0 SECTION LOCAL DEFAULT 21 22: 00011000 0 SECTION LOCAL DEFAULT 22 23: 00011024 0 SECTION LOCAL DEFAULT 23 24: 00011028 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 00008420 0 NOTYPE LOCAL DEFAULT 13 $a 30: 00008688 0 NOTYPE LOCAL DEFAULT 16 $d 31: 00008450 0 NOTYPE LOCAL DEFAULT 13 $d 32: 0000866c 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011024 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: 0000845c 0 NOTYPE LOCAL DEFAULT 13 $a 36: 0000845c 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008478 0 NOTYPE LOCAL DEFAULT 13 $d 38: 000083c4 0 NOTYPE LOCAL DEFAULT 11 $a 39: 00008664 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: 000083cc 0 NOTYPE LOCAL DEFAULT 11 $a 42: 00008668 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 44: 00010f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 45: 00008480 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008480 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 47: 000084b4 0 NOTYPE LOCAL DEFAULT 13 $d 48: 000084b8 0 NOTYPE LOCAL DEFAULT 13 $a 49: 000084b8 0 FUNC LOCAL DEFAULT 13 register_tm_clones 50: 00008670 0 NOTYPE LOCAL DEFAULT 15 $d 51: 000084f8 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 52: 00011028 1 OBJECT LOCAL DEFAULT 24 completed.8853 53: 00010f08 0 NOTYPE LOCAL DEFAULT 19 $d 54: 00010f08 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 55: 00008520 0 FUNC LOCAL DEFAULT 13 frame_dummy 56: 00010f04 0 NOTYPE LOCAL DEFAULT 18 $d 57: 00010f04 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 58: 00011028 0 NOTYPE LOCAL DEFAULT 24 $d 59: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 60: 00008674 0 NOTYPE LOCAL DEFAULT 15 $d 61: 00008554 0 NOTYPE LOCAL DEFAULT 13 $a 62: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 63: 000085fc 0 NOTYPE LOCAL DEFAULT 13 $a 64: 00008658 0 NOTYPE LOCAL DEFAULT 13 $d 65: 00008690 0 NOTYPE LOCAL DEFAULT 16 $d 66: 00008660 0 NOTYPE LOCAL DEFAULT 13 $a 67: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 68: 000086a8 0 NOTYPE LOCAL DEFAULT 17 $d 69: 000086a8 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 70: 00010f0c 0 NOTYPE LOCAL DEFAULT 20 $d 71: 00010f0c 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 72: 00000000 0 FILE LOCAL DEFAULT ABS 73: 00010f08 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 74: 00010f10 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 75: 00010f04 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 76: 00011000 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 77: 000083d0 0 NOTYPE LOCAL DEFAULT 12 $a 78: 000083e0 0 NOTYPE LOCAL DEFAULT 12 $d 79: 000083e4 0 NOTYPE LOCAL DEFAULT 12 $a 80: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 81: 00008660 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 83: 00011024 0 NOTYPE WEAK DEFAULT 23 data_start 84: 000083e4 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4 85: 00011028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 87: 00011028 0 NOTYPE GLOBAL DEFAULT 23 _edata 88: 00008664 0 FUNC GLOBAL DEFAULT 14 _fini 89: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 90: 00011024 0 NOTYPE GLOBAL DEFAULT 23 __data_start 91: 000083f0 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 92: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 93: 00008670 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 94: 00008554 100 FUNC GLOBAL DEFAULT 13 announcement 95: 0000866c 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 96: 000085fc 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 97: 00008408 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 98: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 _end 99: 00008420 0 FUNC GLOBAL DEFAULT 13 _start 100: 0001102c 0 NOTYPE GLOBAL DEFAULT 24 __end__ 101: 00011028 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 102: 000085b8 68 FUNC GLOBAL DEFAULT 13 main 103: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 104: 00011028 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 105: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 106: 00008414 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 107: 000083c4 0 FUNC GLOBAL DEFAULT 11 _init ../build-tree/includes-test-stock ../build-tree/includes-test-stock: ok (0x8554) # Compiler options enabled. (linker is not wrapper) cc -fstack-protector --param ssp-buffer-size=4 -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 0x84ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0000871c 0x0000871c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x00740 0x00740 R E 0x8000 LOAD 0x000ec4 0x00010ec4 0x00010ec4 0x00140 0x0014c RW 0x8000 DYNAMIC 0x000ed0 0x00010ed0 0x00010ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00010ec4 0x00010ec4 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) 0x8468 0x0000000d (FINI) 0x86f8 0x00000019 (INIT_ARRAY) 0x10ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x82b0 0x00000006 (SYMTAB) 0x81f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x10fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x8438 0x00000011 (REL) 0x8428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x83c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x83b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00010ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00011008 00000614 R_ARM_COPY 00011008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00010fe4 00000a16 R_ARM_JUMP_SLOT 00008488 __stack_chk_fail 00010fe8 00000b16 R_ARM_JUMP_SLOT 00008494 __libc_start_main 00010fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00010ff0 00000716 R_ARM_JUMP_SLOT 000084ac snprintf 00010ff4 00000816 R_ARM_JUMP_SLOT 000084b8 __printf_chk 00010ff8 00000916 R_ARM_JUMP_SLOT 000084c4 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: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00008494 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081f0 0 SECTION LOCAL DEFAULT 5 6: 000082b0 0 SECTION LOCAL DEFAULT 6 7: 000083b0 0 SECTION LOCAL DEFAULT 7 8: 000083c8 0 SECTION LOCAL DEFAULT 8 9: 00008428 0 SECTION LOCAL DEFAULT 9 10: 00008438 0 SECTION LOCAL DEFAULT 10 11: 00008468 0 SECTION LOCAL DEFAULT 11 12: 00008474 0 SECTION LOCAL DEFAULT 12 13: 000084d0 0 SECTION LOCAL DEFAULT 13 14: 000086f8 0 SECTION LOCAL DEFAULT 14 15: 00008700 0 SECTION LOCAL DEFAULT 15 16: 0000871c 0 SECTION LOCAL DEFAULT 16 17: 0000873c 0 SECTION LOCAL DEFAULT 17 18: 00010ec4 0 SECTION LOCAL DEFAULT 18 19: 00010ec8 0 SECTION LOCAL DEFAULT 19 20: 00010ecc 0 SECTION LOCAL DEFAULT 20 21: 00010ed0 0 SECTION LOCAL DEFAULT 21 22: 00010fd8 0 SECTION LOCAL DEFAULT 22 23: 00011000 0 SECTION LOCAL DEFAULT 23 24: 00011008 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000084ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0000871c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0000851c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00008700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011000 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: 00008528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00008528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00008468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000086f8 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: 00008470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000086fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00008620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000084d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0000854c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0000854c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00008580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00008584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00008584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00008704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000085c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0001100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00010ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00010ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000085ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00010ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0001100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00008690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000086ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00008724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000086f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0000873c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0000873c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00010ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00010ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00010ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00010fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00008474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00008484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00008488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000086f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00011000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00011004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000086f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00011000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00008494 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00008704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00008620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00008700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00008690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000084ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000084d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00011004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00008468 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 (0x8620) ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x8620) # Compiler and linker options enabled. cc -fstack-protector --param ssp-buffer-size=4 -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 0x84ec There are 9 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x00071c 0x0000871c 0x0000871c 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4 INTERP 0x000154 0x00008154 0x00008154 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x00740 0x00740 R E 0x8000 LOAD 0x000ec4 0x00010ec4 0x00010ec4 0x00140 0x0014c RW 0x8000 DYNAMIC 0x000ed0 0x00010ed0 0x00010ed0 0x00108 0x00108 RW 0x4 NOTE 0x000170 0x00008170 0x00008170 0x00044 0x00044 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x000ec4 0x00010ec4 0x00010ec4 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) 0x8468 0x0000000d (FINI) 0x86f8 0x00000019 (INIT_ARRAY) 0x10ec4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x10ec8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x81b4 0x00000005 (STRTAB) 0x82b0 0x00000006 (SYMTAB) 0x81f0 0x0000000a (STRSZ) 256 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x10fd8 0x00000002 (PLTRELSZ) 48 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x8438 0x00000011 (REL) 0x8428 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffffe (VERNEED) 0x83c8 0x6fffffff (VERNEEDNUM) 3 0x6ffffff0 (VERSYM) 0x83b0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x428 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 00010ffc 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__ 00011008 00000614 R_ARM_COPY 00011008 __stack_chk_guard Relocation section '.rel.plt' at offset 0x438 contains 6 entries: Offset Info Type Sym. Value Symbol's Name 00010fe4 00000a16 R_ARM_JUMP_SLOT 00008488 __stack_chk_fail 00010fe8 00000b16 R_ARM_JUMP_SLOT 00008494 __libc_start_main 00010fec 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__ 00010ff0 00000716 R_ARM_JUMP_SLOT 000084ac snprintf 00010ff4 00000816 R_ARM_JUMP_SLOT 000084b8 __printf_chk 00010ff8 00000916 R_ARM_JUMP_SLOT 000084c4 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: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@GLIBC_2.4 (3) 7: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.4 (4) 8: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (4) 9: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (4) 10: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (4) 11: 00008494 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: 00008154 0 SECTION LOCAL DEFAULT 1 2: 00008170 0 SECTION LOCAL DEFAULT 2 3: 00008190 0 SECTION LOCAL DEFAULT 3 4: 000081b4 0 SECTION LOCAL DEFAULT 4 5: 000081f0 0 SECTION LOCAL DEFAULT 5 6: 000082b0 0 SECTION LOCAL DEFAULT 6 7: 000083b0 0 SECTION LOCAL DEFAULT 7 8: 000083c8 0 SECTION LOCAL DEFAULT 8 9: 00008428 0 SECTION LOCAL DEFAULT 9 10: 00008438 0 SECTION LOCAL DEFAULT 10 11: 00008468 0 SECTION LOCAL DEFAULT 11 12: 00008474 0 SECTION LOCAL DEFAULT 12 13: 000084d0 0 SECTION LOCAL DEFAULT 13 14: 000086f8 0 SECTION LOCAL DEFAULT 14 15: 00008700 0 SECTION LOCAL DEFAULT 15 16: 0000871c 0 SECTION LOCAL DEFAULT 16 17: 0000873c 0 SECTION LOCAL DEFAULT 17 18: 00010ec4 0 SECTION LOCAL DEFAULT 18 19: 00010ec8 0 SECTION LOCAL DEFAULT 19 20: 00010ecc 0 SECTION LOCAL DEFAULT 20 21: 00010ed0 0 SECTION LOCAL DEFAULT 21 22: 00010fd8 0 SECTION LOCAL DEFAULT 22 23: 00011000 0 SECTION LOCAL DEFAULT 23 24: 00011008 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: 00008170 0 NOTYPE LOCAL DEFAULT 2 $d 29: 000084ec 0 NOTYPE LOCAL DEFAULT 13 $a 30: 0000871c 0 NOTYPE LOCAL DEFAULT 16 $d 31: 0000851c 0 NOTYPE LOCAL DEFAULT 13 $d 32: 00008700 0 NOTYPE LOCAL DEFAULT 15 $d 33: 00011000 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: 00008528 0 NOTYPE LOCAL DEFAULT 13 $a 36: 00008528 0 FUNC LOCAL DEFAULT 13 call_weak_fn 37: 00008544 0 NOTYPE LOCAL DEFAULT 13 $d 38: 00008468 0 NOTYPE LOCAL DEFAULT 11 $a 39: 000086f8 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: 00008470 0 NOTYPE LOCAL DEFAULT 11 $a 42: 000086fc 0 NOTYPE LOCAL DEFAULT 14 $a 43: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 44: 00008620 0 NOTYPE LOCAL DEFAULT 13 $a 45: 000084d0 0 NOTYPE LOCAL DEFAULT 13 $a 46: 00008708 0 NOTYPE LOCAL DEFAULT 15 $d 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 49: 0000854c 0 NOTYPE LOCAL DEFAULT 13 $a 50: 0000854c 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones 51: 00008580 0 NOTYPE LOCAL DEFAULT 13 $d 52: 00008584 0 NOTYPE LOCAL DEFAULT 13 $a 53: 00008584 0 FUNC LOCAL DEFAULT 13 register_tm_clones 54: 00008704 0 NOTYPE LOCAL DEFAULT 15 $d 55: 000085c4 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 56: 0001100c 1 OBJECT LOCAL DEFAULT 24 completed.8853 57: 00010ec8 0 NOTYPE LOCAL DEFAULT 19 $d 58: 00010ec8 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry 59: 000085ec 0 FUNC LOCAL DEFAULT 13 frame_dummy 60: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 $d 61: 00010ec4 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry 62: 0001100c 0 NOTYPE LOCAL DEFAULT 24 $d 63: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.oS 64: 00008690 0 NOTYPE LOCAL DEFAULT 13 $a 65: 000086ec 0 NOTYPE LOCAL DEFAULT 13 $d 66: 00008724 0 NOTYPE LOCAL DEFAULT 16 $d 67: 000086f4 0 NOTYPE LOCAL DEFAULT 13 $a 68: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 69: 0000873c 0 NOTYPE LOCAL DEFAULT 17 $d 70: 0000873c 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 71: 00010ecc 0 NOTYPE LOCAL DEFAULT 20 $d 72: 00010ecc 0 OBJECT LOCAL DEFAULT 20 __JCR_END__ 73: 00000000 0 FILE LOCAL DEFAULT ABS 74: 00010ec8 0 NOTYPE LOCAL DEFAULT 18 __init_array_end 75: 00010ed0 0 OBJECT LOCAL DEFAULT 21 _DYNAMIC 76: 00010ec4 0 NOTYPE LOCAL DEFAULT 18 __init_array_start 77: 00010fd8 0 OBJECT LOCAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 78: 00008474 0 NOTYPE LOCAL DEFAULT 12 $a 79: 00008484 0 NOTYPE LOCAL DEFAULT 12 $d 80: 00008488 0 NOTYPE LOCAL DEFAULT 12 $a 81: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0@@GCC_3.5 82: 000086f4 4 FUNC GLOBAL DEFAULT 13 __libc_csu_fini 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 84: 00011000 0 NOTYPE WEAK DEFAULT 23 data_start 85: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start__ 86: 00011008 4 OBJECT GLOBAL DEFAULT 24 __stack_chk_guard@@GLIBC_2.4 87: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _bss_end__ 88: 00011004 0 NOTYPE GLOBAL DEFAULT 23 _edata 89: 000086f8 0 FUNC GLOBAL DEFAULT 14 _fini 90: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __bss_end__ 91: 00008488 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 92: 00011000 0 NOTYPE GLOBAL DEFAULT 23 __data_start 93: 00008494 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.4 94: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 95: 00008704 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 96: 00008620 112 FUNC GLOBAL DEFAULT 13 announcement 97: 00008700 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 98: 00008690 100 FUNC GLOBAL DEFAULT 13 __libc_csu_init 99: 000084ac 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.4 100: 00011010 0 NOTYPE GLOBAL DEFAULT 24 _end 101: 000084ec 0 FUNC GLOBAL DEFAULT 13 _start 102: 000084b8 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4 103: 00011010 0 NOTYPE GLOBAL DEFAULT 24 __end__ 104: 00011004 0 NOTYPE GLOBAL DEFAULT 24 __bss_start 105: 000084d0 28 FUNC GLOBAL DEFAULT 13 main 106: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 107: 00011004 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__ 108: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 109: 000084c4 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4 110: 00008468 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 (0x8620) ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x8620) # 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 0x00010ec4 0x00010ec4 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 --param ssp-buffer-size=4 -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 (0x8640) # Build .o with -fPIC already defined cc -fPIC -fstack-protector --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 (0x8640) # Make sure build fails due to -Werror=format-security ! cc -fstack-protector --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 does not stack-protects a tiny ssp buffer cc -fstack-protector --param ssp-buffer-size=4 -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-skip ssp-buffer-size-skip.c # Test Stack Protector is correctly skipped ! nm ../build-tree/includes-test-ssp-buffer-size-skip | egrep '__stack_chk_fail($|@@GLIBC)' cc -fstack-protector --param ssp-buffer-size=4 -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 0x594 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 0x5ec 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 0x4e0 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 --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 --param ssp-buffer-size=4 -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 0x841c There are 8 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x000624 0x00008624 0x00008624 0x00020 0x00020 R 0x4 PHDR 0x000034 0x00008034 0x00008034 0x00100 0x00100 R E 0x4 INTERP 0x000134 0x00008134 0x00008134 0x00019 0x00019 R 0x1 [Requesting program interpreter: /lib/ld-linux-armhf.so.3] LOAD 0x000000 0x00008000 0x00008000 0x00648 0x00648 R E 0x8000 LOAD 0x000648 0x00010648 0x00010648 0x00124 0x00128 RW 0x8000 DYNAMIC 0x000654 0x00010654 0x00010654 0x000f0 0x000f0 RW 0x4 NOTE 0x000150 0x00008150 0x00008150 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) 0x83a4 0x0000000d (FINI) 0x8600 0x00000019 (INIT_ARRAY) 0x10648 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x1064c 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x8194 0x00000005 (STRTAB) 0x8264 0x00000006 (SYMTAB) 0x81c4 0x0000000a (STRSZ) 188 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x10744 0x00000002 (PLTRELSZ) 40 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x837c 0x00000011 (REL) 0x8374 0x00000012 (RELSZ) 8 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x8334 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0x8320 0x00000000 (NULL) 0x0 make[2]: Leaving directory `/builddir/build/BUILD/hardening-wrapper/tests' make[1]: Leaving directory `/builddir/build/BUILD/hardening-wrapper/tests' Processing files: hardening-check-2.5-1.el7.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.ArLzYY + exit 0 + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper + DOCDIR=/builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + cp -pr AUTHORS /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + cp -pr TODO /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + cp -pr debian/changelog /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + cp -pr debian/copyright /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + cp -pr debian/README.Debian /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch/usr/share/doc/hardening-check-2.5 + exit 0 Provides: hardening-check = 2.5-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-check-2.5-1.el7.noarch Wrote: /builddir/build/RPMS/hardening-check-2.5-1.el7.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.8Fotxe + umask 022 + cd /builddir/build/BUILD + cd hardening-wrapper + /usr/bin/rm -rf /builddir/build/BUILDROOT/hardening-check-2.5-1.el7.noarch + exit 0 Child return code was: 0 LEAVE do -->