From patchwork Tue Mar 25 07:41:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Zeter X-Patchwork-Id: 109135 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66BD13858D33 for ; Tue, 25 Mar 2025 07:44:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66BD13858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=j19W0hwn X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 0D3333857B9F for ; Tue, 25 Mar 2025 07:42:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D3333857B9F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D3333857B9F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742888545; cv=none; b=a+Mzj0VOeGnA72M8e0QRJUzEe7oIxkqoXUG3rfGUROGoG6rl1Le3j2287jb5k91NsRQo0Y9kJ/jau/FLaO5glPWt+q7DxhqPVeWOgcyP/uAyx56fHOBoYrVsujQRhuglkB6KHA7W2ELLr07Mu3O/ZLdMJI+F5qAhYstDfmRMfVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742888545; c=relaxed/simple; bh=hf9q3e0GGpJo5ZXM6uVrenkE+1O8G4KoFSKUSJFJLMs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=epmEB+8XztOFeE8S6a7Lxx4yh1slrleDCatLidRvc4LUOFkDWzv+gRkx5qkkEe+K4K/XN4MoXoBSPvcvgpVRxtTpiuCL75xXBgKSWbd+4sa6GFS2ggTrE2Mub1iGF/wa3UGoHuThiWwTbXkE4pWxB91+a/iADGTtXuiUOQ1Ao20= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D3333857B9F Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-301918a4e3bso9674990a91.3 for ; Tue, 25 Mar 2025 00:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742888543; x=1743493343; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=H5vbkn0DsvlomzWCocuG+tsqrLjguZRZKSicESHCc6k=; b=j19W0hwn6OhMaiK08TJYPW2r7VRmzDYsWcTbWBXCV5f643XUTXqx3KPhKe9NmBxKJn TkOf6mM6xsvHXDAskCfZ9dz3vmj0WRqByCw6E04ZuBDho+HvLAs5VbwcLqSFEZPhXp7X SJTL9wXrHaMIonb6VzAxk6LaXH7dgqYibAEur7Z2msUvYfqZE/Mx4wFSgHm/lPQxTUVD hKyWnp4tJFmIDISuzw/qzrrb4YqMcyd1kHqvxpZFnpboKBIHmQ+TqWszq9ndZj866ZA6 KI69o47p2zInkxBz1cx78ZhTj7vb7TvX2fPKuSqbaTGyvjM3ieWwG/3Eu5fhPv+euJje SqkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742888543; x=1743493343; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H5vbkn0DsvlomzWCocuG+tsqrLjguZRZKSicESHCc6k=; b=OaqMavthy5NXcbUUcczlaHT4TY8A24hqkOowswHfhfeVdHpVPxtlUA50YCUiGitWZQ 5t+XtLsKb/ZGoihawv74C9HGyROuTMwwquxGww/Emz2mCUWnE1tgvNBejl14ukfvBWgK HGQTs3R9T4WkzyQz59gWT7fai2x1LbEqQ4vCsnxL5IHp6cpB60sMkNEh7Zp2Dh+W6+fK CMi0Mbixk6/jJ/BmbE+I6kx+hGR8A5G/0/Fe8Mxsr0GlDC6IxmqRQz2eIFidQpyvY8T8 L1sOKUdgKq5KQPrWQjr8pUb8sgfBJ4W/3oj9s/iMvtUyjFj+eRLLtWJ4mRo1mUaUtg1D Q60A== X-Gm-Message-State: AOJu0Yzq3/xLILWtZDnAacqoj+E603EEeZYqYntagq7da55ryHE5MFhN r4PGYdKIcH1TNyYmPoTvx3aOebUNlhxfhk/2chImTUNtHX+xWRkZqS2eOTaW X-Gm-Gg: ASbGnctqA9xNjbzSL1nMHjzoGMbbQg2sxUg7E5ZkJifEJ2xeT9ARC/TdiTJlPOhR64B GoVq7z8euIaj+dbMSjMcTLRtyxUXASddPxOUeVaoSvZBsnXhe4ObtrN92oh3gYiasKwMTQNPrS4 usBFGRpfb9PLNUbLVLkvdmfd++IRuMe11snUlcw98DFz2wnrv4JqGHG8zMnNI65Ay+KArbKx2tB yHExwIsTy4qiiuCHU8NFYqCrb6DfQi7TZdhqsx0sAqkfok8d89phEC1U9jGvAhVb/SQF7HaiKYm 8erqpv+WfHXXkwuSGZ3VFFIEyRByykFFWvWgQbh7cA== X-Google-Smtp-Source: AGHT+IHlraInldDaiE0lkxBCczTkveqUzmVJK1nAErvA3/OQBOOM2Bx50f92UdN+0y+ZFX5eaYG17w== X-Received: by 2002:a17:90b:2647:b0:2ff:592d:23bc with SMTP id 98e67ed59e1d1-3030fe58cc6mr26067231a91.4.1742888542708; Tue, 25 Mar 2025 00:42:22 -0700 (PDT) Received: from fedora.. ([115.130.17.70]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3030f7e9d93sm9473331a91.30.2025.03.25.00.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 00:42:22 -0700 (PDT) From: Samuel Zeter To: libc-alpha@sourceware.org Cc: Samuel Zeter Subject: [PATCH v2] Add 'Key to Flags' to eu-readelf output [bz 29571] Date: Tue, 25 Mar 2025 17:41:21 +1000 Message-ID: <20250325074151.59026-1-samuelzeter@gmail.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org When printing section headers, also include a key to what each flag is at the end of the section header output. Signed-off-by: Samuel Zeter --- This version fixes tests which failed in the first patch. src/readelf.c | 11 ++++++ tests/run-copyadd-sections.sh | 4 +-- tests/run-large-elf-file.sh | 2 +- tests/run-readelf-z.sh | 32 +++++++++++++++++ tests/run-retain.sh | 4 +++ tests/run-strip-remove-keep.sh | 64 ++++++++++++++++++++++++++++++++++ tests/test-copymany-subr.sh | 2 +- 7 files changed, 115 insertions(+), 4 deletions(-) diff --git a/src/readelf.c b/src/readelf.c index 12d85472..f9c1c742 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -341,6 +341,7 @@ static void print_strings (Ebl *ebl); static void dump_archive_index (Elf *, const char *); static void print_dwarf_addr (Dwfl_Module *dwflmod, int address_size, Dwarf_Addr address, Dwarf_Addr raw); +static void print_flag_info(void); enum dyn_idx { @@ -1406,9 +1407,19 @@ There are %zd section headers, starting at offset %#" PRIx64 ":\n\ } } + print_flag_info(); fputc ('\n', stdout); } +/* Print flag information. */ +static void +print_flag_info (void) +{ + puts ("Key to Flags:"); + puts (" W (write), A (alloc), X (execute), M (merge), S (strings), I (info),"); + puts (" L (link order), N (extra OS processing required), G (group), T (TLS),"); + puts (" C (compressed), O (ordered), R (GNU retain), E (exclude)"); +} /* Print the program header. */ static void diff --git a/tests/run-copyadd-sections.sh b/tests/run-copyadd-sections.sh index bc20f6ee..f8304926 100755 --- a/tests/run-copyadd-sections.sh +++ b/tests/run-copyadd-sections.sh @@ -33,7 +33,7 @@ test_copy_and_add () # Can we add a section (in-place)? testrun ${abs_builddir}/addsections 3 ${out_file} testrun ${abs_top_builddir}/src/readelf -S ${out_file} > readelf.out - nr=$(grep '.extra' readelf.out | wc -l) + nr=$(grep '\.extra' readelf.out | wc -l) if test ${nr} != 3; then # Show what went wrong testrun ${abs_top_builddir}/src/readelf -S ${out_file} @@ -49,7 +49,7 @@ test_copy_and_add () # because mremap cannot extend too much. testrun ${abs_builddir}/addsections --mmap 1 ${out_file_mmap} testrun ${abs_top_builddir}/src/readelf -S ${out_file_mmap} > readelf.out - nr=$(grep '.extra' readelf.out | wc -l) + nr=$(grep '\.extra' readelf.out | wc -l) if test ${nr} != 1; then # Show what went wrong testrun ${abs_top_builddir}/src/readelf -S ${out_file_mmap} diff --git a/tests/run-large-elf-file.sh b/tests/run-large-elf-file.sh index 8108cb4b..249ecd99 100755 --- a/tests/run-large-elf-file.sh +++ b/tests/run-large-elf-file.sh @@ -84,7 +84,7 @@ test_file () echo "addsections 2 ${in_file} 2147483648" testrun ${abs_builddir}/addsections 2 ${in_file} 2147483648 testrun ${abs_top_builddir}/src/readelf -S ${in_file} > ${readelf_out} - nr=$(grep '.extra' ${readelf_out} | wc -l) + nr=$(grep '\.extra' ${readelf_out} | wc -l) if test ${nr} != 2; then # Show what went wrong cat ${readelf_out} diff --git a/tests/run-readelf-z.sh b/tests/run-readelf-z.sh index 6dbd2f14..859d801e 100755 --- a/tests/run-readelf-z.sh +++ b/tests/run-readelf-z.sh @@ -38,6 +38,10 @@ Section Headers: [ 6] .shstrtab STRTAB 0000000000000000 00000384 00000059 0 0 0 1 [ 7] .symtab SYMTAB 0000000000000000 000000a8 00000168 24 8 8 8 [ 8] .strtab STRTAB 0000000000000000 00000210 0000004b 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -61,6 +65,10 @@ Section Headers: [ 7] .shstrtab STRTAB 0000000000000000 000003d0 00000063 0 0 0 1 [ 8] .symtab SYMTAB 0000000000000000 000000f0 00000180 24 9 9 8 [ 9] .strtab STRTAB 0000000000000000 00000270 00000044 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -83,6 +91,10 @@ Section Headers: [ 6] .shstrtab STRTAB 0000000000000000 000003a8 00000056 0 0 0 1 [ 7] .symtab SYMTAB 0000000000000000 000000a8 00000168 24 8 8 8 [ 8] .strtab STRTAB 0000000000000000 00000210 0000004b 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -106,6 +118,10 @@ Section Headers: [ 7] .shstrtab STRTAB 0000000000000000 000003f4 00000060 0 0 0 1 [ 8] .symtab SYMTAB 0000000000000000 000000f0 00000180 24 9 9 8 [ 9] .strtab STRTAB 0000000000000000 00000270 00000044 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -128,6 +144,10 @@ Section Headers: [ 6] .shstrtab STRTAB 00000000 0002e2 000059 0 0 0 1 [ 7] .symtab SYMTAB 00000000 000080 0000f0 16 8 8 4 [ 8] .strtab STRTAB 00000000 000170 00004b 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -151,6 +171,10 @@ Section Headers: [ 7] .shstrtab STRTAB 00000000 00032c 000063 0 0 0 1 [ 8] .symtab SYMTAB 00000000 0000c8 000110 16 9 9 4 [ 9] .strtab STRTAB 00000000 0001d8 000045 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -173,6 +197,10 @@ Section Headers: [ 6] .shstrtab STRTAB 00000000 0002e2 000056 0 0 0 1 [ 7] .symtab SYMTAB 00000000 000080 0000f0 16 8 8 4 [ 8] .strtab STRTAB 00000000 000170 00004b 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -196,6 +224,10 @@ Section Headers: [ 7] .shstrtab STRTAB 00000000 00032c 000060 0 0 0 1 [ 8] .symtab SYMTAB 00000000 0000c8 000110 16 9 9 4 [ 9] .strtab STRTAB 00000000 0001d8 000045 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF diff --git a/tests/run-retain.sh b/tests/run-retain.sh index c5376de4..ac39a65b 100755 --- a/tests/run-retain.sh +++ b/tests/run-retain.sh @@ -38,6 +38,10 @@ Section Headers: [ 6] .symtab SYMTAB 0000000000000000 00000078 00000090 24 7 6 8 [ 7] .strtab STRTAB 0000000000000000 00000108 00000001 0 0 0 1 [ 8] .shstrtab STRTAB 0000000000000000 00000109 0000004c 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF diff --git a/tests/run-strip-remove-keep.sh b/tests/run-strip-remove-keep.sh index 92647fa7..c2bd63f4 100755 --- a/tests/run-strip-remove-keep.sh +++ b/tests/run-strip-remove-keep.sh @@ -63,6 +63,10 @@ Section Headers: [24] .strtab STRTAB 00000000 0007d8 000235 0 0 0 1 [25] .gnu_debuglink PROGBITS 00000000 000a10 000014 0 0 0 4 [26] .shstrtab STRTAB 00000000 000a24 0000d1 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -106,6 +110,10 @@ Section Headers: [32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1 [33] .symtab SYMTAB 00000000 003e64 0005a0 16 34 68 4 [34] .strtab STRTAB 00000000 004404 000235 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -150,6 +158,10 @@ Section Headers: [25] .strtab STRTAB 00000000 000ce8 000235 0 0 0 1 [26] .gnu_debuglink PROGBITS 00000000 000f20 000014 0 0 0 4 [27] .shstrtab STRTAB 00000000 000f34 0000d9 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -193,6 +205,10 @@ Section Headers: [32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1 [33] .symtab NOBITS 00000000 003e64 0005a0 16 34 68 4 [34] .strtab NOBITS 00000000 003e64 000235 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -238,6 +254,10 @@ Section Headers: [24] .strtab STRTAB 0000000000000000 0000085c 00000175 0 0 0 1 [25] .gnu_debuglink PROGBITS 0000000000000000 000009d4 00000014 0 0 0 4 [26] .shstrtab STRTAB 0000000000000000 000009e8 000000ee 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -273,6 +293,10 @@ Section Headers: [24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1 [25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8 [26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -317,6 +341,10 @@ Section Headers: [24] .strtab STRTAB 0000000000000000 00000d10 00000175 0 0 0 1 [25] .gnu_debuglink PROGBITS 0000000000000000 00000e88 00000014 0 0 0 4 [26] .shstrtab STRTAB 0000000000000000 00000e9c 000000ed 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -352,6 +380,10 @@ Section Headers: [24] .shstrtab STRTAB 0000000000000000 000001ec 000000e7 0 0 0 1 [25] .symtab NOBITS 0000000000000000 000002d8 000004f8 24 26 44 8 [26] .strtab NOBITS 0000000000000000 000002d8 00000175 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -396,6 +428,10 @@ Section Headers: [25] .strtab STRTAB 00000000 0007d8 000235 0 0 0 1 [26] .gnu_debuglink PROGBITS 00000000 000a10 000014 0 0 0 4 [27] .shstrtab STRTAB 00000000 000a24 0000d7 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -439,6 +475,10 @@ Section Headers: [32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1 [33] .symtab SYMTAB 00000000 003e64 0005a0 16 34 68 4 [34] .strtab STRTAB 00000000 004404 000235 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -484,6 +524,10 @@ Section Headers: [26] .note NOTE 00000000 00278c 0000a0 0 0 0 1 [27] .gnu_debuglink PROGBITS 00000000 00282c 000014 0 0 0 4 [28] .shstrtab STRTAB 00000000 002840 0000de 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -527,6 +571,10 @@ Section Headers: [32] .shstrtab STRTAB 00000000 001ce2 00012e 0 0 0 1 [33] .symtab SYMTAB 00000000 001e10 0005a0 16 34 68 4 [34] .strtab STRTAB 00000000 0023b0 000235 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -570,6 +618,10 @@ Section Headers: [24] .strtab STRTAB 0000000000000000 0000085c 00000175 0 0 0 1 [25] .gnu_debuglink PROGBITS 0000000000000000 000009d4 00000014 0 0 0 4 [26] .shstrtab STRTAB 0000000000000000 000009e8 000000ee 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -605,6 +657,10 @@ Section Headers: [24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1 [25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8 [26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF @@ -647,6 +703,10 @@ Section Headers: [23] .comment PROGBITS 0000000000000000 00000830 0000002c 1 MS 0 0 1 [24] .gnu_debuglink PROGBITS 0000000000000000 0000085c 00000014 0 0 0 4 [25] .shstrtab STRTAB 0000000000000000 00000870 000000e6 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF echo readelf testfile.debug @@ -682,6 +742,10 @@ Section Headers: [24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1 [25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8 [26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), N (extra OS processing required), G (group), T (TLS), + C (compressed), O (ordered), R (GNU retain), E (exclude) EOF diff --git a/tests/test-copymany-subr.sh b/tests/test-copymany-subr.sh index 054103b4..ed39a69b 100755 --- a/tests/test-copymany-subr.sh +++ b/tests/test-copymany-subr.sh @@ -37,7 +37,7 @@ test_copy_and_add () # Can we add a section (in-place)? testrun ${abs_builddir}/addsections 32768 ${out_file} testrun ${abs_top_builddir}/src/readelf -S ${out_file} > readelf.out - nr=$(grep '.extra' readelf.out | wc -l) + nr=$(grep '\.extra' readelf.out | wc -l) # We try twice... if test ${nr} != 32768 -a ${nr} != 65536; then # Show what went wrong