From: Gleb Fotengauer-Malinovskiy Date: Thu, 9 Sep 2021 20:15:10 +0300 Subject: readelf, objdump: add --no-wide option support diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index defaced..defaced 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -2231,7 +2231,7 @@ objdump [@option{-a}|@option{--archive-headers}] [@option{-t}|@option{--syms}] [@option{-T}|@option{--dynamic-syms}] [@option{-x}|@option{--all-headers}] - [@option{-w}|@option{--wide}] + [@option{-w}|@option{--wide}|@option{--no-wide}] [@option{--start-address=}@var{address}] [@option{--stop-address=}@var{address}] [@option{--no-addresses}] @@ -2939,6 +2939,10 @@ relocation entries. Using @option{-x} is equivalent to specifying all of Format some lines for output devices that have more than 80 columns. Also do not truncate symbol names when they are displayed. +@item --no-wide +@cindex wide output, printing +Format some lines to fit into 80 columns. + @item -z @itemx --disassemble-zeroes Normally the disassembly output will skip blocks of zeroes. This @@ -4822,7 +4826,7 @@ readelf [@option{-a}|@option{--all}] [@option{--ctf-strings=}@var{section}] [@option{-I}|@option{--histogram}] [@option{-v}|@option{--version}] - [@option{-W}|@option{--wide}] + [@option{-W}|@option{--wide}|@option{--no-wide}] [@option{-T}|@option{--silent-truncation}] [@option{-H}|@option{--help}] @var{elffile}@dots{} @@ -5092,6 +5096,9 @@ Don't break output lines to fit into 80 columns. By default @command{readelf} to print each section header resp. each segment one a single line, which is far more readable on terminals wider than 80 columns. +@item --no-wide +Break output lines to fit into 80 columns. + @item -T @itemx --silent-truncation Normally when readelf is displaying a symbol name, and it has to diff --git a/binutils/objdump.c b/binutils/objdump.c index defaced..defaced 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -413,7 +413,8 @@ enum option_values OPTION_CTF, OPTION_CTF_PARENT, #endif - OPTION_VISUALIZE_JUMPS + OPTION_VISUALIZE_JUMPS, + OPTION_NO_WIDE, }; static struct option long_options[]= @@ -470,6 +471,7 @@ static struct option long_options[]= {"target", required_argument, NULL, 'b'}, {"version", no_argument, NULL, 'V'}, {"wide", no_argument, NULL, 'w'}, + {"no-wide", no_argument, NULL, OPTION_NO_WIDE}, {"prefix", required_argument, NULL, OPTION_PREFIX}, {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, @@ -5270,6 +5272,9 @@ main (int argc, char **argv) case 'w': do_wide = wide_output = true; break; + case OPTION_NO_WIDE: + do_wide = wide_output = false; + break; case OPTION_ADJUST_VMA: adjust_section_vma = parse_vma (optarg, "--adjust-vma"); break; diff --git a/binutils/readelf.c b/binutils/readelf.c index defaced..defaced 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4634,7 +4634,8 @@ enum long_option_values OPTION_RECURSE_LIMIT, OPTION_NO_RECURSE_LIMIT, OPTION_NO_DEMANGLING, - OPTION_SYM_BASE + OPTION_SYM_BASE, + OPTION_NO_WIDE, }; static struct option options[] = @@ -4672,6 +4673,7 @@ static struct option options[] = {"version-info", no_argument, 0, 'V'}, {"version", no_argument, 0, 'v'}, {"wide", no_argument, 0, 'W'}, + {"no-wide", no_argument, 0, OPTION_NO_WIDE}, {"hex-dump", required_argument, 0, 'x'}, {"decompress", no_argument, 0, 'z'}, @@ -5101,6 +5103,9 @@ parse_args (struct dump_data *dumpdata, int argc, char ** argv) case 'W': do_wide = true; break; + case OPTION_NO_WIDE: + do_wide = false; + break; case 'T': do_not_show_symbol_truncation = true; break;