pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/check Only check ELF binaries for RELRO



details:   https://anonhg.NetBSD.org/pkgsrc/rev/92a17fe11062
branches:  trunk
changeset: 364829:92a17fe11062
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Wed Jul 05 15:24:22 2017 +0000

description:
Only check ELF binaries for RELRO

diffstat:

 mk/check/check-relro-elf.awk |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r bae40c2277f7 -r 92a17fe11062 mk/check/check-relro-elf.awk
--- a/mk/check/check-relro-elf.awk      Wed Jul 05 13:40:02 2017 +0000
+++ b/mk/check/check-relro-elf.awk      Wed Jul 05 15:24:22 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: check-relro-elf.awk,v 1.1 2017/07/04 18:29:24 khorben Exp $
+# $NetBSD: check-relro-elf.awk,v 1.2 2017/07/05 15:24:22 khorben Exp $
 #
 # Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 # Copyright (c) 2017 Pierre Pronchery <khorben%NetBSD.org@localhost>.
@@ -69,15 +69,16 @@
        return out;
 }
 
-function checkrelro(ELF, got_relro) {
+function checkrelro(ELF, got_relro, found) {
        cmd = readelf " -Wl " shquote(ELF) " 2> /dev/null"
        while ((cmd | getline) > 0) {
+               found = 1
                if ($1 == "GNU_RELRO") {
                        got_relro = 1
                }
        }
        close(cmd)
-       if (got_relro != 1) {
+       if (found == 1 && got_relro != 1) {
                print ELF ": missing RELRO"
        }
 }



Home | Main Index | Thread Index | Old Index