<86>Dec 4 16:02:28 userdel[1520411]: delete user 'rooter' <86>Dec 4 16:02:28 userdel[1520411]: removed group 'rooter' owned by 'rooter' <86>Dec 4 16:02:28 userdel[1520411]: removed shadow group 'rooter' owned by 'rooter' <86>Dec 4 16:02:28 groupadd[1520423]: group added to /etc/group: name=rooter, GID=621 <86>Dec 4 16:02:28 groupadd[1520423]: group added to /etc/gshadow: name=rooter <86>Dec 4 16:02:28 groupadd[1520423]: new group: name=rooter, GID=621 <86>Dec 4 16:02:28 useradd[1520430]: new user: name=rooter, UID=621, GID=621, home=/root, shell=/bin/bash <86>Dec 4 16:02:28 userdel[1520443]: delete user 'builder' <86>Dec 4 16:02:28 userdel[1520443]: removed group 'builder' owned by 'builder' <86>Dec 4 16:02:28 userdel[1520443]: removed shadow group 'builder' owned by 'builder' <86>Dec 4 16:02:28 groupadd[1520451]: group added to /etc/group: name=builder, GID=622 <86>Dec 4 16:02:28 groupadd[1520451]: group added to /etc/gshadow: name=builder <86>Dec 4 16:02:28 groupadd[1520451]: new group: name=builder, GID=622 <86>Dec 4 16:02:28 useradd[1520458]: new user: name=builder, UID=622, GID=622, home=/usr/src, shell=/bin/bash warning: user mike does not exist - using root warning: group mike does not exist - using root warning: user mike does not exist - using root warning: group mike does not exist - using root warning: user mike does not exist - using root warning: group mike does not exist - using root <13>Dec 4 16:02:31 rpmi: perl-Term-Cap-1.17-alt1 1445018869 installed <13>Dec 4 16:02:31 rpmi: perl-Term-ANSIColor-5.01-alt1 sisyphus+244783.100.1.2 1579747505 installed <13>Dec 4 16:02:31 rpmi: perl-Pod-Escapes-1.07-alt1 1418767892 installed <13>Dec 4 16:02:31 rpmi: perl-Filter-1.60-alt1 sisyphus+258375.300.14.2 1600904226 installed <13>Dec 4 16:02:31 rpmi: perl-Encode-3.07-alt1 sisyphus+258375.400.14.2 1600904306 installed <13>Dec 4 16:02:31 rpmi: perl-Pod-Simple-3.42-alt1 sisyphus+261979.100.1.1 1605684633 installed <13>Dec 4 16:02:31 rpmi: perl-Pod-Usage-2.01-alt1 sisyphus+260315.100.1.3 1603550551 installed <13>Dec 4 16:02:31 rpmi: perl-podlators-4.14-alt1 sisyphus+243914.100.1.1 1578493399 installed Building target platforms: i586 Building for target i586 Wrote: /usr/src/in/nosrpm/hardening-wrapper-2.6-alt1.nosrc.rpm Installing hardening-wrapper-2.6-alt1.src.rpm Building target platforms: i586 Building for target i586 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.58079 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf hardening-wrapper-2.6 + /bin/mkdir -p hardening-wrapper-2.6 + cd hardening-wrapper-2.6 + echo 'Source #0 (hardening-wrapper_2.6.tar.xz):' Source #0 (hardening-wrapper_2.6.tar.xz): + /usr/bin/xz -dc /usr/src/RPM/SOURCES/hardening-wrapper_2.6.tar.xz + /bin/tar -xf - + /bin/chmod -c -Rf u+rwX,go-w . + echo 'Patch #0 (hardening-wrapper-2.6-fix_perl.patch):' Patch #0 (hardening-wrapper-2.6-fix_perl.patch): + /usr/bin/patch -p1 patching file hardening-wrapper/Makefile + sed -i.debian -e '/^[ \t]*if \[ -z \"\$.DEB_/d' hardening-wrapper/Makefile + exit 0 Executing(%build): /bin/sh -e /usr/src/tmp/rpm-tmp.58079 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd hardening-wrapper-2.6 + make -j8 -C hardening-wrapper make: Entering directory '/usr/src/RPM/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 '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper' + exit 0 Executing(%install): /bin/sh -e /usr/src/tmp/rpm-tmp.21331 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + /bin/chmod -Rf u+rwX -- /usr/src/tmp/hardening-wrapper-buildroot + : + /bin/rm -rf -- /usr/src/tmp/hardening-wrapper-buildroot + cd hardening-wrapper-2.6 + install -pDm0755 hardening-wrapper/build-tree/hardening-check /usr/src/tmp/hardening-wrapper-buildroot/usr/bin/hardening-check + install -pDm0644 hardening-wrapper/build-tree/hardening-check.1 /usr/src/tmp/hardening-wrapper-buildroot/usr/share/man/man1/hardening-check.1 + /usr/lib/rpm/brp-alt Cleaning files in /usr/src/tmp/hardening-wrapper-buildroot (auto) Verifying and fixing files in /usr/src/tmp/hardening-wrapper-buildroot (binconfig,pkgconfig,libtool,desktop) Checking contents of files in /usr/src/tmp/hardening-wrapper-buildroot/ (default) Compressing files in /usr/src/tmp/hardening-wrapper-buildroot (auto) Verifying ELF objects in /usr/src/tmp/hardening-wrapper-buildroot (arch=normal,fhs=normal,lfs=relaxed,lint=relaxed,rpath=normal,stack=normal,textrel=normal,unresolved=normal) Hardlinking identical .pyc and .pyo files Executing(%check): /bin/sh -e /usr/src/tmp/rpm-tmp.39414 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd hardening-wrapper-2.6 + make -j8 -C hardening-wrapper check make: Entering directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper' make -C tests check make[1]: Entering directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. make[1]: Leaving directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: Entering directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' # Check the stack protector and PIE options directly, just to have # a historical record in the build logs. cc -Wall -fstack-protector hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x566001b9) cc -Wall -fstack-protector-strong hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x566261b9) cc -Wall -fPIE -pie hello.c -o ../build-tree/cc-test || true ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x565ad1b9) ../build-tree/cc-test || true ../build-tree/cc-test: ok (0x565f31b9) make -f Makefile.wrapper check make[2]: Entering directory '/usr/src/RPM/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_wrapper -B ../build-tree/ -o ../build-tree/wrapper-test-stock hello.c readelf -ldrsW ../build-tree/wrapper-test-stock Elf file type is DYN (Shared object file) Entry point 0x1080 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x0041c 0x0041c R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00318 0x00318 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001e8 0x001e8 R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x0005c 0x0005c R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x1304 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 186 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x3fc 0x00000011 (REL) 0x3bc 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x37c 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x366 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3bc contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000406 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000506 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x3fc contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 printf@GLIBC_2.0 00003fe0 00000307 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe4 00000607 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.0 (2) 3: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 4: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (4) 5: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 6: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (2) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (2) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 84 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000366 0 SECTION LOCAL DEFAULT 7 8: 0000037c 0 SECTION LOCAL DEFAULT 8 9: 000003bc 0 SECTION LOCAL DEFAULT 9 10: 000003fc 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 00001304 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 00002074 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 37: 000010d0 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 38: 00001110 0 FUNC LOCAL DEFAULT 14 register_tm_clones 39: 00001160 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 40: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 41: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 42: 000011b0 0 FUNC LOCAL DEFAULT 14 frame_dummy 43: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 44: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021e4 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012e0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010c0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 00000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.0 61: 000012e1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 62: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 63: 00001304 0 FUNC GLOBAL HIDDEN 15 _fini 64: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 65: 000011b5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 66: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 67: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 68: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 69: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 70: 000011b9 128 FUNC GLOBAL DEFAULT 14 announcement 71: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 72: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 73: 00001280 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 74: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 75: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 76: 00001080 54 FUNC GLOBAL DEFAULT 14 _start 77: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 78: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 79: 00001239 62 FUNC GLOBAL DEFAULT 14 main 80: 00001277 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.ax 81: 000012f0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 82: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable ../build-tree/wrapper-test-stock ../build-tree/wrapper-test-stock: ok (0x565741b9) # 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_wrapper -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 DYN (Shared object file) Entry point 0x10b0 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x00444 0x00444 R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00308 0x00308 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001fc 0x001fc R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x00054 0x00054 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x12f4 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 211 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x424 0x00000011 (REL) 0x3e4 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x394 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x380 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3e4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000306 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000406 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x424 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe0 00000507 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe4 00000607 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 __printf_chk@GLIBC_2.3.4 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (2) 3: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (3) 4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 5: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (4) 6: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (4) 7: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.3.4 (5) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 83 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000380 0 SECTION LOCAL DEFAULT 7 8: 00000394 0 SECTION LOCAL DEFAULT 8 9: 000003e4 0 SECTION LOCAL DEFAULT 9 10: 00000424 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 000012f4 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 0000206c 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 37: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 38: 00001100 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 39: 00001140 0 FUNC LOCAL DEFAULT 14 register_tm_clones 40: 00001190 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 41: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 42: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 43: 000011e0 0 FUNC LOCAL DEFAULT 14 frame_dummy 44: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021f8 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012d0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010f0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 000012d1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 61: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 62: 000012f4 0 FUNC GLOBAL HIDDEN 15 _fini 63: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 64: 000011e5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 65: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 66: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 67: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 68: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 69: 000011f0 118 FUNC GLOBAL DEFAULT 14 announcement 70: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 71: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 72: 00001270 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 73: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 74: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 75: 000010b0 54 FUNC GLOBAL DEFAULT 14 _start 76: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 77: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 78: 00001080 46 FUNC GLOBAL DEFAULT 14 main 79: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.3.4 80: 000012e0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 81: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x565f71f0) ../build-tree/wrapper-test-compiled ../build-tree/wrapper-test-compiled: ok (0x566141f0) # 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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-linked hello.c /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/ccwsl4EF.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-linked /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. /usr/src/tmp/cc7CtuIE.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../crtn.o readelf -ldrsW ../build-tree/wrapper-test-linked Elf file type is DYN (Shared object file) Entry point 0x10b0 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x00444 0x00444 R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00308 0x00308 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001fc 0x001fc R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x00054 0x00054 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x12f4 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 211 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x424 0x00000011 (REL) 0x3e4 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x394 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x380 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3e4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000306 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000406 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x424 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe0 00000507 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe4 00000607 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 __printf_chk@GLIBC_2.3.4 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (2) 3: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (3) 4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 5: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (4) 6: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (4) 7: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.3.4 (5) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 83 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000380 0 SECTION LOCAL DEFAULT 7 8: 00000394 0 SECTION LOCAL DEFAULT 8 9: 000003e4 0 SECTION LOCAL DEFAULT 9 10: 00000424 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 000012f4 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 0000206c 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 37: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 38: 00001100 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 39: 00001140 0 FUNC LOCAL DEFAULT 14 register_tm_clones 40: 00001190 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 41: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 42: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 43: 000011e0 0 FUNC LOCAL DEFAULT 14 frame_dummy 44: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021f8 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012d0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010f0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 000012d1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 61: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 62: 000012f4 0 FUNC GLOBAL HIDDEN 15 _fini 63: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 64: 000011e5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 65: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 66: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 67: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 68: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 69: 000011f0 118 FUNC GLOBAL DEFAULT 14 announcement 70: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 71: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 72: 00001270 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 73: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 74: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 75: 000010b0 54 FUNC GLOBAL DEFAULT 14 _start 76: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 77: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 78: 00001080 46 FUNC GLOBAL DEFAULT 14 main 79: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.3.4 80: 000012e0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 81: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable # Run twice to show off PIE, if available in kernel ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x566411f0) ../build-tree/wrapper-test-linked ../build-tree/wrapper-test-linked: ok (0x565b61f0) # 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: yes 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.3.4 # Test Format (no-op currently) # Test for RELRO readelf -lW ../build-tree/wrapper-test-linked | grep GNU_RELRO GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC-direct hello.c /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/cclssv4a.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-fPIC-direct /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. /usr/src/tmp/ccrKR2d8.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../crtn.o ../build-tree/wrapper-test-fPIC-direct ../build-tree/wrapper-test-fPIC-direct: ok (0x565b1200) # 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_wrapper -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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -fPIC -O2 -o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC.o /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/cchAHjuB.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-fPIC /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. ../build-tree/wrapper-test-fPIC.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../crtn.o ../build-tree/wrapper-test-fPIC ../build-tree/wrapper-test-fPIC: ok (0x565e7200) # 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_wrapper -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] 11 | 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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -Wno-format-security -o ../build-tree/wrapper-test-format-security format.c /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/cc8ADhyP.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-format-security /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. /usr/src/tmp/ccpyULGP.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-size-protect ssp-buffer-size-protect.c /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/ccdglneZ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-ssp-buffer-size-protect /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. /usr/src/tmp/ccNVv4wZ.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../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_wrapper -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -B ../build-tree/ -O2 -o ../build-tree/wrapper-test-ssp-buffer-type-protect ssp-buffer-type-protect.c /usr/bin/ld -z relro -plugin /usr/libexec/gcc/i586-alt-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/i586-alt-linux/10/lto-wrapper -plugin-opt=-fresolution=/usr/src/tmp/ccLVFbDL.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu --as-needed -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o ../build-tree/wrapper-test-ssp-buffer-type-protect /usr/lib/gcc/i586-alt-linux/10/../../../Scrt1.o /usr/lib/gcc/i586-alt-linux/10/../../../crti.o /usr/lib/gcc/i586-alt-linux/10/crtbeginS.o -L../build-tree -L/usr/lib/gcc/i586-alt-linux/10 -L/usr/lib/gcc/i586-alt-linux/10/../../.. /usr/src/tmp/cc8MXTgN.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/i586-alt-linux/10/crtendS.o /usr/lib/gcc/i586-alt-linux/10/../../../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_wrapper -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. There is no dynamic section in this file. Relocation section '.rel.text' at offset 0x3b4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00000003 00000f02 R_386_PC32 00000000 __x86.get_pc_thunk.bx 00000009 0000100a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 0000002b 00000a09 R_386_GOTOFF 00000000 .LC0 0000003b 00001104 R_386_PLT32 00000000 snprintf 00000041 00000e09 R_386_GOTOFF 00000000 announcement 00000048 00000b09 R_386_GOTOFF 00000003 .LC1 00000051 00001204 R_386_PLT32 00000000 __printf_chk 00000072 00001302 R_386_PC32 00000000 __stack_chk_fail_local Relocation section '.rel.text.startup' at offset 0x3f4 contains 1 entry: Offset Info Type Sym. Value Symbol's Name 00000017 00000e02 R_386_PC32 00000000 announcement Relocation section '.rel.eh_frame' at offset 0x3fc contains 3 entries: Offset Info Type Sym. Value Symbol's Name 00000020 00000202 R_386_PC32 00000000 .text 00000074 00000602 R_386_PC32 00000000 .text.startup 000000a0 00000702 R_386_PC32 00000000 .text.__x86.get_pc_thunk.bx 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 2 3: 00000000 0 SECTION LOCAL DEFAULT 4 4: 00000000 0 SECTION LOCAL DEFAULT 5 5: 00000000 0 SECTION LOCAL DEFAULT 6 6: 00000000 0 SECTION LOCAL DEFAULT 7 7: 00000000 0 SECTION LOCAL DEFAULT 9 8: 00000000 0 SECTION LOCAL DEFAULT 11 9: 00000000 0 SECTION LOCAL DEFAULT 12 10: 00000000 0 NOTYPE LOCAL DEFAULT 6 .LC0 11: 00000003 0 NOTYPE LOCAL DEFAULT 6 .LC1 12: 00000000 0 SECTION LOCAL DEFAULT 10 13: 00000000 0 SECTION LOCAL DEFAULT 1 14: 00000000 118 FUNC GLOBAL DEFAULT 2 announcement 15: 00000000 0 FUNC GLOBAL HIDDEN 9 __x86.get_pc_thunk.bx 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 18: 00000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 19: 00000000 0 NOTYPE GLOBAL HIDDEN UND __stack_chk_fail_local 20: 00000000 46 FUNC GLOBAL DEFAULT 7 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_wrapper -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. There is no dynamic section in this file. Relocation section '.rel.text' at offset 0x3b0 contains 11 entries: Offset Info Type Sym. Value Symbol's Name 0000000b 00000e02 R_386_PC32 00000000 __x86.get_pc_thunk.bx 00000011 00000f0a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 00000031 00000509 R_386_GOTOFF 00000000 .rodata 00000043 00001004 R_386_PLT32 00000000 snprintf 0000004f 00000d09 R_386_GOTOFF 00000000 announcement 0000005d 00000509 R_386_GOTOFF 00000000 .rodata 00000063 00001104 R_386_PLT32 00000000 printf 00000077 00001202 R_386_PC32 00000000 __stack_chk_fail_local 00000092 00001402 R_386_PC32 00000000 __x86.get_pc_thunk.ax 00000097 00000f0a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 000000a7 00000d02 R_386_PC32 00000000 announcement Relocation section '.rel.eh_frame' at offset 0x408 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00000020 00000202 R_386_PC32 00000000 .text 00000044 00000202 R_386_PC32 00000000 .text 00000070 00000602 R_386_PC32 00000000 .text.__x86.get_pc_thunk.ax 00000084 00000702 R_386_PC32 00000000 .text.__x86.get_pc_thunk.bx 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 3 3: 00000000 0 SECTION LOCAL DEFAULT 5 4: 00000000 0 SECTION LOCAL DEFAULT 6 5: 00000000 0 SECTION LOCAL DEFAULT 7 6: 00000000 0 SECTION LOCAL DEFAULT 8 7: 00000000 0 SECTION LOCAL DEFAULT 9 8: 00000000 0 SECTION LOCAL DEFAULT 11 9: 00000000 0 SECTION LOCAL DEFAULT 12 10: 00000000 0 SECTION LOCAL DEFAULT 10 11: 00000000 0 SECTION LOCAL DEFAULT 1 12: 00000000 0 SECTION LOCAL DEFAULT 2 13: 00000000 128 FUNC GLOBAL DEFAULT 3 announcement 14: 00000000 0 FUNC GLOBAL HIDDEN 9 __x86.get_pc_thunk.bx 15: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf 18: 00000000 0 NOTYPE GLOBAL HIDDEN UND __stack_chk_fail_local 19: 00000080 62 FUNC GLOBAL DEFAULT 3 main 20: 00000000 0 FUNC GLOBAL HIDDEN 8 __x86.get_pc_thunk.ax 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: yes 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 '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make -f Makefile.includes check make[2]: Entering directory '/usr/src/RPM/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 DYN (Shared object file) Entry point 0x1080 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x0041c 0x0041c R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00318 0x00318 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001e8 0x001e8 R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x0005c 0x0005c R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x1304 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 186 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x3fc 0x00000011 (REL) 0x3bc 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x37c 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x366 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3bc contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000406 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000506 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x3fc contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 printf@GLIBC_2.0 00003fe0 00000307 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe4 00000607 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.0 (2) 3: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (3) 4: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (4) 5: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 6: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (2) 7: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (2) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 84 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000366 0 SECTION LOCAL DEFAULT 7 8: 0000037c 0 SECTION LOCAL DEFAULT 8 9: 000003bc 0 SECTION LOCAL DEFAULT 9 10: 000003fc 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 00001304 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 00002074 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 37: 000010d0 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 38: 00001110 0 FUNC LOCAL DEFAULT 14 register_tm_clones 39: 00001160 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 40: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 41: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 42: 000011b0 0 FUNC LOCAL DEFAULT 14 frame_dummy 43: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 44: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021e4 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012e0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010c0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 00000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.0 61: 000012e1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 62: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 63: 00001304 0 FUNC GLOBAL HIDDEN 15 _fini 64: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 65: 000011b5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 66: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 67: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 68: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 69: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 70: 000011b9 128 FUNC GLOBAL DEFAULT 14 announcement 71: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 72: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 73: 00001280 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 74: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 75: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 76: 00001080 54 FUNC GLOBAL DEFAULT 14 _start 77: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 78: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 79: 00001239 62 FUNC GLOBAL DEFAULT 14 main 80: 00001277 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.ax 81: 000012f0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 82: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 83: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable ../build-tree/includes-test-stock ../build-tree/includes-test-stock: ok (0x566471b9) # 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 DYN (Shared object file) Entry point 0x10b0 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x00444 0x00444 R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00308 0x00308 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001fc 0x001fc R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x00054 0x00054 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x12f4 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 211 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x424 0x00000011 (REL) 0x3e4 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x394 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x380 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3e4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000306 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000406 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x424 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe0 00000507 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe4 00000607 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 __printf_chk@GLIBC_2.3.4 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (2) 3: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (3) 4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 5: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (4) 6: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (4) 7: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.3.4 (5) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 83 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000380 0 SECTION LOCAL DEFAULT 7 8: 00000394 0 SECTION LOCAL DEFAULT 8 9: 000003e4 0 SECTION LOCAL DEFAULT 9 10: 00000424 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 000012f4 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 0000206c 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 37: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 38: 00001100 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 39: 00001140 0 FUNC LOCAL DEFAULT 14 register_tm_clones 40: 00001190 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 41: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 42: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 43: 000011e0 0 FUNC LOCAL DEFAULT 14 frame_dummy 44: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021f8 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012d0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010f0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 000012d1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 61: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 62: 000012f4 0 FUNC GLOBAL HIDDEN 15 _fini 63: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 64: 000011e5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 65: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 66: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 67: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 68: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 69: 000011f0 118 FUNC GLOBAL DEFAULT 14 announcement 70: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 71: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 72: 00001270 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 73: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 74: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 75: 000010b0 54 FUNC GLOBAL DEFAULT 14 _start 76: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 77: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 78: 00001080 46 FUNC GLOBAL DEFAULT 14 main 79: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.3.4 80: 000012e0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 81: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x566511f0) ../build-tree/includes-test-compiled ../build-tree/includes-test-compiled: ok (0x565a41f0) # 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 DYN (Shared object file) Entry point 0x10b0 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00160 0x00160 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x00444 0x00444 R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x00308 0x00308 R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001fc 0x001fc R 0x1000 LOAD 0x002ecc 0x00003ecc 0x00003ecc 0x00138 0x0013c RW 0x1000 DYNAMIC 0x002ed8 0x00003ed8 0x00003ed8 0x000f8 0x000f8 RW 0x4 NOTE 0x0001a8 0x000001a8 0x000001a8 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x00054 0x00054 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 R 0x1 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 10 .init_array .fini_array .data.rel.ro .dynamic .got Dynamic section at offset 0x2ed8 contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x12f4 0x00000019 (INIT_ARRAY) 0x3ecc 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x3ed0 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1ec 0x00000005 (STRTAB) 0x2ac 0x00000006 (SYMTAB) 0x20c 0x0000000a (STRSZ) 211 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x3fd0 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x424 0x00000011 (REL) 0x3e4 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000018 (BIND_NOW) 0x6ffffffb (FLAGS_1) Flags: NOW PIE 0x6ffffffe (VERNEED) 0x394 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x380 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x3e4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00003ecc 00000008 R_386_RELATIVE 00003ed0 00000008 R_386_RELATIVE 00003ed4 00000008 R_386_RELATIVE 00003ff8 00000008 R_386_RELATIVE 00003fec 00000106 R_386_GLOB_DAT 00000000 _ITM_deregisterTMCloneTable 00003ff0 00000306 R_386_GLOB_DAT 00000000 __cxa_finalize@GLIBC_2.1.3 00003ff4 00000406 R_386_GLOB_DAT 00000000 __gmon_start__ 00003ffc 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTable Relocation section '.rel.plt' at offset 0x424 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00003fdc 00000207 R_386_JUMP_SLOT 00000000 __stack_chk_fail@GLIBC_2.4 00003fe0 00000507 R_386_JUMP_SLOT 00000000 __libc_start_main@GLIBC_2.0 00003fe4 00000607 R_386_JUMP_SLOT 00000000 snprintf@GLIBC_2.0 00003fe8 00000707 R_386_JUMP_SLOT 00000000 __printf_chk@GLIBC_2.3.4 Symbol table '.dynsym' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 2: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (2) 3: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (3) 4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 5: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (4) 6: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@GLIBC_2.0 (4) 7: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.3.4 (5) 8: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable 9: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used Symbol table '.symtab' contains 83 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000194 0 SECTION LOCAL DEFAULT 1 2: 000001a8 0 SECTION LOCAL DEFAULT 2 3: 000001cc 0 SECTION LOCAL DEFAULT 3 4: 000001ec 0 SECTION LOCAL DEFAULT 4 5: 0000020c 0 SECTION LOCAL DEFAULT 5 6: 000002ac 0 SECTION LOCAL DEFAULT 6 7: 00000380 0 SECTION LOCAL DEFAULT 7 8: 00000394 0 SECTION LOCAL DEFAULT 8 9: 000003e4 0 SECTION LOCAL DEFAULT 9 10: 00000424 0 SECTION LOCAL DEFAULT 10 11: 00001000 0 SECTION LOCAL DEFAULT 11 12: 00001020 0 SECTION LOCAL DEFAULT 12 13: 00001070 0 SECTION LOCAL DEFAULT 13 14: 00001080 0 SECTION LOCAL DEFAULT 14 15: 000012f4 0 SECTION LOCAL DEFAULT 15 16: 00002000 0 SECTION LOCAL DEFAULT 16 17: 00002018 0 SECTION LOCAL DEFAULT 17 18: 0000206c 0 SECTION LOCAL DEFAULT 18 19: 00003ecc 0 SECTION LOCAL DEFAULT 19 20: 00003ed0 0 SECTION LOCAL DEFAULT 20 21: 00003ed4 0 SECTION LOCAL DEFAULT 21 22: 00003ed8 0 SECTION LOCAL DEFAULT 22 23: 00003fd0 0 SECTION LOCAL DEFAULT 23 24: 00004000 0 SECTION LOCAL DEFAULT 24 25: 00004004 0 SECTION LOCAL DEFAULT 25 26: 00000000 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00004008 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 FILE LOCAL DEFAULT ABS init.c 36: 00000000 0 FILE LOCAL DEFAULT ABS hello.c 37: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 38: 00001100 0 FUNC LOCAL DEFAULT 14 deregister_tm_clones 39: 00001140 0 FUNC LOCAL DEFAULT 14 register_tm_clones 40: 00001190 0 FUNC LOCAL DEFAULT 14 __do_global_dtors_aux 41: 00004004 1 OBJECT LOCAL DEFAULT 25 completed.0 42: 00003ed0 0 OBJECT LOCAL DEFAULT 20 __do_global_dtors_aux_fini_array_entry 43: 000011e0 0 FUNC LOCAL DEFAULT 14 frame_dummy 44: 00003ecc 0 OBJECT LOCAL DEFAULT 19 __frame_dummy_init_array_entry 45: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c 46: 00000000 0 FILE LOCAL DEFAULT ABS stack_chk_fail_local.c 47: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 48: 000021f8 0 OBJECT LOCAL DEFAULT 18 __FRAME_END__ 49: 00000000 0 FILE LOCAL DEFAULT ABS 50: 00003ed0 0 NOTYPE LOCAL DEFAULT 19 __init_array_end 51: 00003ed8 0 OBJECT LOCAL DEFAULT 22 _DYNAMIC 52: 00003ecc 0 NOTYPE LOCAL DEFAULT 19 __init_array_start 53: 00002018 0 NOTYPE LOCAL DEFAULT 17 __GNU_EH_FRAME_HDR 54: 00003fd0 0 OBJECT LOCAL DEFAULT 23 _GLOBAL_OFFSET_TABLE_ 55: 00001000 0 FUNC LOCAL DEFAULT 11 _init 56: 000012d0 1 FUNC GLOBAL DEFAULT 14 __libc_csu_fini 57: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable 58: 000010f0 4 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bx 59: 00004000 0 NOTYPE WEAK DEFAULT 24 data_start 60: 000012d1 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.bp 61: 00004004 0 NOTYPE GLOBAL DEFAULT 24 _edata 62: 000012f4 0 FUNC GLOBAL HIDDEN 15 _fini 63: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2.4 64: 000011e5 0 FUNC GLOBAL HIDDEN 14 __x86.get_pc_thunk.dx 65: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1.3 66: 00004000 0 NOTYPE GLOBAL DEFAULT 24 __data_start 67: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 68: 00003ed4 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 69: 000011f0 118 FUNC GLOBAL DEFAULT 14 announcement 70: 00002004 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used 71: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_2.0 72: 00001270 93 FUNC GLOBAL DEFAULT 14 __libc_csu_init 73: 00000000 0 FUNC GLOBAL DEFAULT UND snprintf@@GLIBC_2.0 74: 00004008 0 NOTYPE GLOBAL DEFAULT 25 _end 75: 000010b0 54 FUNC GLOBAL DEFAULT 14 _start 76: 00002000 4 OBJECT GLOBAL DEFAULT 16 _fp_hw 77: 00004004 0 NOTYPE GLOBAL DEFAULT 25 __bss_start 78: 00001080 46 FUNC GLOBAL DEFAULT 14 main 79: 00000000 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.3.4 80: 000012e0 20 FUNC GLOBAL HIDDEN 14 __stack_chk_fail_local 81: 00004004 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ 82: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable # Run twice to show off PIE, if available in kernel ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x565961f0) ../build-tree/includes-test-linked ../build-tree/includes-test-linked: ok (0x565a31f0) # 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: yes 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.3.4 # Test Format (no-op currently) # Test for RELRO readelf -lW ../build-tree/includes-test-linked | grep GNU_RELRO GNU_RELRO 0x002ecc 0x00003ecc 0x00003ecc 0x00134 0x00134 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 (0x56648200) # 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 (0x56612200) # 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] 11 | 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. There is no dynamic section in this file. Relocation section '.rel.text' at offset 0x3b4 contains 8 entries: Offset Info Type Sym. Value Symbol's Name 00000003 00000f02 R_386_PC32 00000000 __x86.get_pc_thunk.bx 00000009 0000100a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 0000002b 00000a09 R_386_GOTOFF 00000000 .LC0 0000003b 00001104 R_386_PLT32 00000000 snprintf 00000041 00000e09 R_386_GOTOFF 00000000 announcement 00000048 00000b09 R_386_GOTOFF 00000003 .LC1 00000051 00001204 R_386_PLT32 00000000 __printf_chk 00000072 00001302 R_386_PC32 00000000 __stack_chk_fail_local Relocation section '.rel.text.startup' at offset 0x3f4 contains 1 entry: Offset Info Type Sym. Value Symbol's Name 00000017 00000e02 R_386_PC32 00000000 announcement Relocation section '.rel.eh_frame' at offset 0x3fc contains 3 entries: Offset Info Type Sym. Value Symbol's Name 00000020 00000202 R_386_PC32 00000000 .text 00000074 00000602 R_386_PC32 00000000 .text.startup 000000a0 00000702 R_386_PC32 00000000 .text.__x86.get_pc_thunk.bx 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 2 3: 00000000 0 SECTION LOCAL DEFAULT 4 4: 00000000 0 SECTION LOCAL DEFAULT 5 5: 00000000 0 SECTION LOCAL DEFAULT 6 6: 00000000 0 SECTION LOCAL DEFAULT 7 7: 00000000 0 SECTION LOCAL DEFAULT 9 8: 00000000 0 SECTION LOCAL DEFAULT 11 9: 00000000 0 SECTION LOCAL DEFAULT 12 10: 00000000 0 NOTYPE LOCAL DEFAULT 6 .LC0 11: 00000003 0 NOTYPE LOCAL DEFAULT 6 .LC1 12: 00000000 0 SECTION LOCAL DEFAULT 10 13: 00000000 0 SECTION LOCAL DEFAULT 1 14: 00000000 118 FUNC GLOBAL DEFAULT 2 announcement 15: 00000000 0 FUNC GLOBAL HIDDEN 9 __x86.get_pc_thunk.bx 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 18: 00000000 0 NOTYPE GLOBAL DEFAULT UND __printf_chk 19: 00000000 0 NOTYPE GLOBAL HIDDEN UND __stack_chk_fail_local 20: 00000000 46 FUNC GLOBAL DEFAULT 7 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. There is no dynamic section in this file. Relocation section '.rel.text' at offset 0x3b0 contains 11 entries: Offset Info Type Sym. Value Symbol's Name 0000000b 00000e02 R_386_PC32 00000000 __x86.get_pc_thunk.bx 00000011 00000f0a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 00000031 00000509 R_386_GOTOFF 00000000 .rodata 00000043 00001004 R_386_PLT32 00000000 snprintf 0000004f 00000d09 R_386_GOTOFF 00000000 announcement 0000005d 00000509 R_386_GOTOFF 00000000 .rodata 00000063 00001104 R_386_PLT32 00000000 printf 00000077 00001202 R_386_PC32 00000000 __stack_chk_fail_local 00000092 00001402 R_386_PC32 00000000 __x86.get_pc_thunk.ax 00000097 00000f0a R_386_GOTPC 00000000 _GLOBAL_OFFSET_TABLE_ 000000a7 00000d02 R_386_PC32 00000000 announcement Relocation section '.rel.eh_frame' at offset 0x408 contains 4 entries: Offset Info Type Sym. Value Symbol's Name 00000020 00000202 R_386_PC32 00000000 .text 00000044 00000202 R_386_PC32 00000000 .text 00000070 00000602 R_386_PC32 00000000 .text.__x86.get_pc_thunk.ax 00000084 00000702 R_386_PC32 00000000 .text.__x86.get_pc_thunk.bx 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 3 3: 00000000 0 SECTION LOCAL DEFAULT 5 4: 00000000 0 SECTION LOCAL DEFAULT 6 5: 00000000 0 SECTION LOCAL DEFAULT 7 6: 00000000 0 SECTION LOCAL DEFAULT 8 7: 00000000 0 SECTION LOCAL DEFAULT 9 8: 00000000 0 SECTION LOCAL DEFAULT 11 9: 00000000 0 SECTION LOCAL DEFAULT 12 10: 00000000 0 SECTION LOCAL DEFAULT 10 11: 00000000 0 SECTION LOCAL DEFAULT 1 12: 00000000 0 SECTION LOCAL DEFAULT 2 13: 00000000 128 FUNC GLOBAL DEFAULT 3 announcement 14: 00000000 0 FUNC GLOBAL HIDDEN 9 __x86.get_pc_thunk.bx 15: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 16: 00000000 0 NOTYPE GLOBAL DEFAULT UND snprintf 17: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf 18: 00000000 0 NOTYPE GLOBAL HIDDEN UND __stack_chk_fail_local 19: 00000080 62 FUNC GLOBAL DEFAULT 3 main 20: 00000000 0 FUNC GLOBAL HIDDEN 8 __x86.get_pc_thunk.ax 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: yes 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: yes 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: yes 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: yes 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: yes 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: yes 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 DYN (Shared object file) Entry point 0x10a0 There are 10 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00140 0x00140 R 0x4 INTERP 0x000174 0x00000174 0x00000174 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] LOAD 0x000000 0x00000000 0x00000000 0x003b8 0x003b8 R 0x1000 LOAD 0x001000 0x00001000 0x00001000 0x002bc 0x002bc R E 0x1000 LOAD 0x002000 0x00002000 0x00002000 0x001d4 0x001d4 R 0x1000 LOAD 0x0021d4 0x000031d4 0x000031d4 0x0012c 0x00130 RW 0x1000 DYNAMIC 0x0021e0 0x000031e0 0x000031e0 0x000f0 0x000f0 RW 0x4 NOTE 0x000188 0x00000188 0x00000188 0x00044 0x00044 R 0x4 GNU_EH_FRAME 0x002018 0x00002018 0x00002018 0x0004c 0x0004c R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt 03 .init .plt .plt.got .text .fini 04 .rodata .eh_frame_hdr .eh_frame 05 .init_array .fini_array .data.rel.ro .dynamic .got .got.plt .data .bss 06 .dynamic 07 .note.gnu.build-id .note.ABI-tag 08 .eh_frame_hdr 09 Dynamic section at offset 0x21e0 contains 26 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x1000 0x0000000d (FINI) 0x12a8 0x00000019 (INIT_ARRAY) 0x31d4 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x31d8 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x6ffffef5 (GNU_HASH) 0x1cc 0x00000005 (STRTAB) 0x27c 0x00000006 (SYMTAB) 0x1ec 0x0000000a (STRSZ) 159 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000015 (DEBUG) 0x0 0x00000003 (PLTGOT) 0x32e4 0x00000002 (PLTRELSZ) 24 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x3a0 0x00000011 (REL) 0x360 0x00000012 (RELSZ) 64 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffb (FLAGS_1) Flags: PIE 0x6ffffffe (VERNEED) 0x330 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x31c 0x6ffffffa (RELCOUNT) 4 0x00000000 (NULL) 0x0 make[2]: Leaving directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make[1]: Leaving directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper/tests' make: Leaving directory '/usr/src/RPM/BUILD/hardening-wrapper-2.6/hardening-wrapper' + exit 0 Processing files: hardening-check-2.6-alt1 Executing(%doc): /bin/sh -e /usr/src/tmp/rpm-tmp.52285 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd hardening-wrapper-2.6 + DOCDIR=/usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + export DOCDIR + rm -rf /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + /bin/mkdir -p /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + cp -prL hardening-wrapper/TODO /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R go-w /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R a+rX /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + cp -prL hardening-wrapper/debian/README.Debian /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R go-w /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R a+rX /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + cp -prL hardening-wrapper/debian/changelog /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R go-w /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R a+rX /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + cp -prL hardening-wrapper/AUTHORS /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R go-w /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R a+rX /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + cp -prL hardening-wrapper/debian/copyright /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R go-w /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + chmod -R a+rX /usr/src/tmp/hardening-wrapper-buildroot/usr/share/doc/hardening-check-2.6 + exit 0 Finding Provides (using /usr/lib/rpm/find-provides) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.6HeSWC find-provides: running scripts (debuginfo,lib,pam,perl,pkgconfig,python,shell) Finding Requires (using /usr/lib/rpm/find-requires) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.10eCGG find-requires: running scripts (cpp,debuginfo,files,lib,pam,perl,pkgconfig,pkgconfiglib,python,rpmlib,shebang,shell,static,symlinks,systemd-services) /usr/src/tmp/hardening-wrapper-buildroot/usr/bin/hardening-check syntax OK Requires: binutils, /usr/bin/perl, perl(Getopt/Long.pm), perl(IPC/Open3.pm), perl(Pod/Usage.pm), perl(Symbol.pm), perl(Term/ANSIColor.pm) Wrote: /usr/src/RPM/RPMS/noarch/hardening-check-2.6-alt1.noarch.rpm 7.19user 1.75system 0:10.33elapsed 86%CPU (0avgtext+0avgdata 20144maxresident)k 0inputs+0outputs (0major+296699minor)pagefaults 0swaps 13.25user 7.30system 0:20.87elapsed 98%CPU (0avgtext+0avgdata 109132maxresident)k 0inputs+0outputs (0major+560561minor)pagefaults 0swaps