summaryrefslogtreecommitdiffstats
path: root/python/xrelfo.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:24 +0000
commit54de8bbe36d7d968c6367939277942518bd4e11f (patch)
tree924f8c16d9c8831679f355b88c620b9b356c9d5a /python/xrelfo.py
parentAdding debian version 10.0.1-0.1. (diff)
downloadfrr-54de8bbe36d7d968c6367939277942518bd4e11f.tar.xz
frr-54de8bbe36d7d968c6367939277942518bd4e11f.zip
Merging upstream version 10.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/xrelfo.py')
-rw-r--r--python/xrelfo.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/python/xrelfo.py b/python/xrelfo.py
index a40b19e..07cd740 100644
--- a/python/xrelfo.py
+++ b/python/xrelfo.py
@@ -22,7 +22,7 @@ import argparse
from clippy.uidhash import uidhash
from clippy.elf import *
-from clippy import frr_top_src, CmdAttr
+from clippy import frr_top_src, CmdAttr, elf_notes
from tiabwarfo import FieldApplicator
from xref2vtysh import CommandEntry
@@ -327,6 +327,7 @@ class Xrelfo(dict):
}
)
self._xrefs = []
+ self.note_warn = False
def load_file(self, filename):
orig_filename = filename
@@ -395,6 +396,15 @@ class Xrelfo(dict):
ptrs = edf.iter_data(XrefPtr, slice(start, end))
else:
+ if elf_notes:
+ self.note_warn = True
+ sys.stderr.write(
+ """%s: warning: binary has no FRRouting.XREF note
+%s- one of FRR_MODULE_SETUP, FRR_DAEMON_INFO or XREF_SETUP must be used
+"""
+ % (orig_filename, orig_filename)
+ )
+
xrefarray = edf.get_section("xref_array")
if xrefarray is None:
raise ValueError("file has neither xref note nor xref_array section")
@@ -471,6 +481,9 @@ def _main(args):
sys.stderr.write("while processing %s:\n" % (fn))
traceback.print_exc()
+ if xrelfo.note_warn and args.Werror:
+ errors += 1
+
for option in dir(args):
if option.startswith("W") and option != "Werror":
checks = sorted(xrelfo.check(args))