diff options
author | Nick Clifton <nickc@redhat.com> | 2017-10-31 13:48:03 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-10-31 13:48:03 +0000 |
commit | 45ac8f4f107f50d77a8514ee8a244b82c1a8ea0c (patch) | |
tree | f28520a0b34c899f57b2a8571b0852e6903e8663 /binutils/readelf.c | |
parent | f871c4853a9725682011c2314ea4308f3c34bd8d (diff) | |
download | gdb-45ac8f4f107f50d77a8514ee8a244b82c1a8ea0c.zip gdb-45ac8f4f107f50d77a8514ee8a244b82c1a8ea0c.tar.gz gdb-45ac8f4f107f50d77a8514ee8a244b82c1a8ea0c.tar.bz2 |
Remind users to use the --use-dynamic command line option to dump dynamic relocations.
* readelf.c (process_relocs): Tell users if no static relocs were
found, but if they had added --use-dynamic to the command line
then relocs would have been displayed.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index 58c28db..f74d484 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -7150,7 +7150,21 @@ process_relocs (FILE * file) } if (! found) - printf (_("\nThere are no relocations in this file.\n")); + { + /* Users sometimes forget the -D option, so try to be helpful. */ + for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++) + { + if (dynamic_info [dynamic_relocations [i].size]) + { + printf (_("\nThere are no static relocations in this file.")); + printf (_("\nTo see the dynamic relocations add --use-dynamic to the command line.\n")); + + break; + } + } + if (i == ARRAY_SIZE (dynamic_relocations)) + printf (_("\nThere are no relocations in this file.\n")); + } } return TRUE; |