pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/check



Module Name:    pkgsrc
Committed By:   khorben
Date:           Wed Jul  5 15:24:22 UTC 2017

Modified Files:
        pkgsrc/mk/check: check-relro-elf.awk

Log Message:
Only check ELF binaries for RELRO


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/check/check-relro-elf.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/check/check-relro-elf.awk
diff -u pkgsrc/mk/check/check-relro-elf.awk:1.1 pkgsrc/mk/check/check-relro-elf.awk:1.2
--- pkgsrc/mk/check/check-relro-elf.awk:1.1     Tue Jul  4 18:29:24 2017
+++ pkgsrc/mk/check/check-relro-elf.awk Wed Jul  5 15:24:22 2017
@@ -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 @@ function shquote(IN, out) {
        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