From 0d487e09e603e7a86fdec911d9b0b4d53c4f1ac5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 14 Sep 2022 00:03:45 +0800 Subject: [PATCH] gcc: update sanity check command and output for default PIE Scrt1.o is used for PIE, instead of crt1.o. --- chapter08/gcc.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 65f502dde..c5c446e9a 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -227,11 +227,11 @@ readelf -l a.out | grep ': /lib' Now make sure that we're setup to use the correct start files: -grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log +grep -E -o '/usr/lib.*/S?crt[1in].*succeeded' dummy.log The output of the last command should be: -/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded +/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded