Index: contrib/elftoolchain/readelf/readelf.1 =================================================================== --- contrib/elftoolchain/readelf/readelf.1 +++ contrib/elftoolchain/readelf/readelf.1 @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3486 2016-08-22 14:10:05Z emaste $ .\" -.Dd September 13, 2012 +.Dd June 19, 2018 .Os .Dt READELF 1 .Sh NAME @@ -57,6 +57,7 @@ .Op Fl S | Fl -sections | Fl -section-headers .Op Fl V | Fl -version-info .Op Fl W | Fl -wide +.Op Fl -print-file-name .Ar file... .Sh DESCRIPTION The @@ -183,6 +184,8 @@ .Nm will list information in the headers of 64 bit ELF objects on two separate lines. +.It Fl -print-file-name +Always print the file name header. .El .Sh EXIT STATUS .Ex -std Index: contrib/elftoolchain/readelf/readelf.c =================================================================== --- contrib/elftoolchain/readelf/readelf.c +++ contrib/elftoolchain/readelf/readelf.c @@ -176,7 +176,8 @@ enum options { - OPTION_DEBUG_DUMP + OPTION_DEBUG_DUMP, + OPTION_PRINT_FILE_NAME, }; static struct option longopts[] = { @@ -184,6 +185,7 @@ {"arch-specific", no_argument, NULL, 'A'}, {"archive-index", no_argument, NULL, 'c'}, {"debug-dump", optional_argument, NULL, OPTION_DEBUG_DUMP}, + {"print-file-name", no_argument, NULL, OPTION_PRINT_FILE_NAME}, {"dynamic", no_argument, NULL, 'd'}, {"file-header", no_argument, NULL, 'h'}, {"full-section-name", no_argument, NULL, 'N'}, @@ -7263,7 +7265,8 @@ -S | --sections | --section-headers\n\ Print information about section headers.\n\ -V | --version-info Print symbol versoning information.\n\ - -W | --wide Print information without wrapping long lines.\n" + -W | --wide Print information without wrapping long lines.\n\ + --print-file-name Always print file name\n" static void @@ -7385,6 +7388,10 @@ case OPTION_DEBUG_DUMP: re->options |= RE_W; parse_dwarf_op_long(re, optarg); + break; + case OPTION_PRINT_FILE_NAME: + re->flags |= DISPLAY_FILENAME; + break; } }