summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-04-13 14:56:48 +0200
committerMark Wielaard <[email protected]>2018-04-13 15:06:16 +0200
commiteaccd7870874d8a9821e298ceaabf492490b3fa7 (patch)
tree9ac916b164ff2c05b05516a8ec5f7042ce08799c /src
parentf881459ffc95b6fad51aa055a158ee14814073aa (diff)
readelf: Only lookup files and show errors in attr_callback when not silent.
We recently added a couple more sanity checks and show an error when attributes that represent files cannot be resolved. We should only do this when the attr_callback should print the attribute information. When not (for example when not showing the .debug_info section, but only collecting information about the CUs containing pointers into other sections) we don't need to lookup the file names, nor print the errors/warnings. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/readelf.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 55eb279c..068c87b9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2018-04-14 Mark Wielaard <[email protected]>
+
+ * readelf.c (attr_callback): Only show errors when not silent.
+
2018-03-23 Mark Wielaard <[email protected]>
* readelf.c (attr_callback): Handle DW_FORM_strx[1234].
diff --git a/src/readelf.c b/src/readelf.c
index 3fb5ee6f..8c0ef6ca 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6253,6 +6253,9 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_AT_decl_file:
case DW_AT_call_file:
{
+ if (cbargs->silent)
+ break;
+
/* Try to get the actual file, the current interface only
gives us full paths, but we only want to show the file
name for now. */