summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2015-11-12 14:09:44 +0100
committerJoakim Sindholt <opensource@zhasha.com>2015-11-12 14:09:44 +0100
commit7ca2f31b6c29cec8b79447b640beadfc321a2aa6 (patch)
tree7e36f16a6856d16b2d449274e16c14e70fe94e9f
parent5e53600f1a9f937ec02357db710f35e6e5cd1439 (diff)
use ld's builtin strip function
-rw-r--r--bin/p9l.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/bin/p9l.sh b/bin/p9l.sh
index a32f449..5968f06 100644
--- a/bin/p9l.sh
+++ b/bin/p9l.sh
@@ -12,7 +12,7 @@ fi
OUTPUT_NAME="${O}.out"
START_SYM="_start"
-USE_STRIP=false
+STRIP_FLAG=""
USE_LTO=true
FILES=()
@@ -36,7 +36,7 @@ do
;;
s)
# strip symbol tabels
- USE_STRIP=true
+ STRIP_FLAG="-s"
;;
a)
# print assembly
@@ -187,16 +187,11 @@ fi
ld.gold \
--gc-sections -pie -Bstatic -Bsymbolic -E -X -e "${START_SYM}" \
-z now -z nodlopen -z nodump -z nodelete -z noexecstack -z text \
- -nostdlib -L"${LIBDIR}" "${OPTS[@]}" -o "${OUTPUT_NAME}" \
+ -nostdlib -L"${LIBDIR}" "${OPTS[@]}" $STRIP_FLAG -o "${OUTPUT_NAME}" \
"${CRTSTART[@]}" '-(' "${FARGS[@]}" "${LIBS[@]}" '-)' "${CRTEND[@]}"
if [ $? -ne 0 ]; then exit 1; fi
perl -- "${DIR}/nuke-pt_interp.pl" "${OUTPUT_NAME}"
if [ $? -ne 0 ]; then exit 1; fi
-objcopy -R .interp "${OUTPUT_FILE}" &>/dev/null
-
-if [ $USE_STRIP == true ]
-then
- strip -s "$OUTPUT_NAME"
- if [ $? -ne 0 ]; then exit 1; fi
-fi
+objcopy -R .interp "${OUTPUT_NAME}" &>/dev/null
+exit 0