From 5424d7ed94cf5a7ca24636ab9f4e6d5c353fc0d3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 2 Feb 2021 05:14:48 -0800 Subject: [PATCH] readelf: Add 'R' and 'D' to "Key to Flags:" Add "R (retain)" and "D (mbind)" to "Key to Flags:". PR binutils/27281 * readelf.c (process_section_headers): Add 'R' and 'D' to "Key to Flags:". * testsuite/binutils-all/retain1a.d: Updated. --- binutils/ChangeLog | 7 +++++++ binutils/readelf.c | 12 ++++++++++++ binutils/testsuite/binutils-all/retain1a.d | 2 ++ 3 files changed, 21 insertions(+) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index cc71947e8f9..6a610a96692 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2021-02-02 H.J. Lu + + PR binutils/27281 + * readelf.c (process_section_headers): Add 'R' and 'D' to + "Key to Flags:". + * testsuite/binutils-all/retain1a.d: Updated. + 2021-01-30 Nick Clifton * README-how-to-make-a-release: Small updates after the 2.35.2 diff --git a/binutils/readelf.c b/binutils/readelf.c index 5df51086226..c61219a4652 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -6992,6 +6992,18 @@ process_section_headers (Filedata * filedata) W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\n\ L (link order), O (extra OS processing required), G (group), T (TLS),\n\ C (compressed), x (unknown), o (OS specific), E (exclude),\n ")); + switch (filedata->file_header.e_ident[EI_OSABI]) + { + case ELFOSABI_GNU: + case ELFOSABI_FREEBSD: + printf (_("R (retain), ")); + /* Fall through */ + case ELFOSABI_NONE: + printf (_("D (mbind), ")); + break; + default: + break; + } if (filedata->file_header.e_machine == EM_X86_64 || filedata->file_header.e_machine == EM_L1OM || filedata->file_header.e_machine == EM_K1OM) diff --git a/binutils/testsuite/binutils-all/retain1a.d b/binutils/testsuite/binutils-all/retain1a.d index 6397ac52ae5..c3cdcaf12e4 100644 --- a/binutils/testsuite/binutils-all/retain1a.d +++ b/binutils/testsuite/binutils-all/retain1a.d @@ -15,4 +15,6 @@ \[[ 0-9]+\] .bss.lsretain0.*WAR.* \[[ 0-9]+\] .bss.lsretain1.*WAR.* \[[ 0-9]+\] .data.lsretain2.*WAR.* +#... + R \(retain\), D \(mbind\), .* #pass -- 2.30.2