summaryrefslogtreecommitdiff
path: root/mk/check
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2019-04-24 22:56:47 +0000
committermaya <maya@pkgsrc.org>2019-04-24 22:56:47 +0000
commit14d6cf13068096956a0ff1c7c3dd279940c218bb (patch)
treef7aa5dc573aba5c225383c72fb1d35b80ba5b1d9 /mk/check
parent61dc5eda196eb27381d5f77420d2dd3eb41b3f06 (diff)
downloadpkgsrc-14d6cf13068096956a0ff1c7c3dd279940c218bb.tar.gz
Don't complain if binaries without an interpreter or .dynamic section don't
have a GNU_RELRO flag. (they won't because it doesn't do anything to them). Should eliminate some of the need for CHECK_RELRO_SKIP, especially for some Go binaries.
Diffstat (limited to 'mk/check')
-rw-r--r--mk/check/check-relro-elf.awk11
1 files changed, 9 insertions, 2 deletions
diff --git a/mk/check/check-relro-elf.awk b/mk/check/check-relro-elf.awk
index 28777f1fbd9..ceeb69c07ba 100644
--- a/mk/check/check-relro-elf.awk
+++ b/mk/check/check-relro-elf.awk
@@ -1,4 +1,4 @@
-# $NetBSD: check-relro-elf.awk,v 1.2 2017/07/05 15:24:22 khorben Exp $
+# $NetBSD: check-relro-elf.awk,v 1.3 2019/04/24 22:56:47 maya Exp $
#
# Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>.
# Copyright (c) 2017 Pierre Pronchery <khorben@NetBSD.org>.
@@ -76,9 +76,16 @@ function checkrelro(ELF, got_relro, found) {
if ($1 == "GNU_RELRO") {
got_relro = 1
}
+ # PT_INTERP for executables
+ # DYNAMIC for libraries, executables
+ if (($1 == "INTERP") ||
+ ($1 == "DYNAMIC")) {
+ dynamic = 1
+ }
+
}
close(cmd)
- if (found == 1 && got_relro != 1) {
+ if (found == 1 && dynamic == 1 && got_relro != 1) {
print ELF ": missing RELRO"
}
}