From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Srikar Dronamraju <srikar@linux.ibm.com>
Cc: Brian Johannesmeyer <bjohannesmeyer@gmail.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "scripts/faddr2line: Combine three readelf calls into one"
Date: Wed, 2 Dec 2026 20:49:52 -0800 [thread overview]
Message-ID: <axDyXQcsAIA7O7v9@jpoimboe> (raw)
In-Reply-To: <aqiqScJg8Ey5QnKl@linux.ibm.com>
On Tue, Sep 15, 2026 at 07:45:37AM +0530, Srikar Dronamraju wrote:
> ++ sed -n '/Symbol table .* contains [0-9]* entries:/q;p'
> ++ sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' /tmp/tmp.BGkKH2pxoy
> + ELF_SECHEADERS='Section Headers:
> [Nr] Name Type Address Off Size ES Flg Lk Inf Al
> [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
> [ 1] .head.text PROGBITS c000000000000000 010000 008000 00 AX 0 0 128
> [ 2] .text PROGBITS c000000000008000 018000 1474ed4 00 AX 0 0 256
> [ 3] .rodata PROGBITS c000000001480000 1490000 6217ce 00 WA 0 0 65536
> [ 4] .pci_fixup PROGBITS c000000001aa17d0 1ab17d0 004590 00 WA 0 0 8
> [ 5] .printk_index PROGBITS c000000001aa5d60 1ab5d60 00f770 00 WA 0 0 8
> [ 6] __ksymtab PROGBITS c000000001ab54d0 1ac54d0 045120 00 A 0 0 8
> [ 7] __kcrctab PROGBITS c000000001afa5f0 1b0a5f0 00b830 00 A 0 0 4
> [ 8] __kflagstab PROGBITS c000000001b05e20 1b15e20 002e0c 00 A 0 0 1
> [ 9] __ksymtab_strings PROGBITS c000000001b08c2c 1b18c2c 039a9c 01 AMS 0 0 1
> [10] __param PROGBITS c000000001b426c8 1b526c8 002e18 00 WA 0 0 8
> [11] __modver PROGBITS c000000001b454e0 1b554e0 0005a0 00 WA 0 0 8
> [12] __ex_table PROGBITS c000000001b45a80 1b55a80 002ab8 00 A 0 0 4
> [13] .notes NOTE c000000001b48538 1b58538 000088 00 A 0 0 4
> [14] .BTF PROGBITS c000000001b50000 1b60000 4d833d 00 A 0 0 1
> [15] .BTF_ids PROGBITS c000000002030000 2040000 00138c 00 A 0 0 1
> [16] .branch_lt PROGBITS c000000002040000 2050000 003030 00 WA 0 0 8
> [17] .got PROGBITS c000000002043100 2053100 000380 08 WA 0 0 256
> [18] __soft_mask_table PROGBITS c000000002043480 2053480 000080 00 A 0 0 8
> [19] __restart_table PROGBITS c000000002043500 2053500 0000c0 00 A 0 0 8
> [20] __stf_entry_barrier_fixup PROGBITS c0000000020435c0 20535c0 0001e8 00 A 0 0 4
> [21] __uaccess_flush_fixup PROGBITS c0000000020437a8 20537a8 000008 00 A 0 0 4
> [22] __entry_flush_fixup PROGBITS c0000000020437b0 20537b0 0001d8 00 A 0 0 4
> [23] __scv_entry_flush_fixup PROGBITS c000000002043988 2053988 000010 00 A 0 0 4
> [24] __stf_exit_barrier_fixup PROGBITS c000000002043998 2053998 000060 00 A 0 0 4
> [25] __rfi_flush_fixup PROGBITS c0000000020439f8 20539f8 000060 00 A 0 0 4
> [26] __spec_barrier_fixup PROGBITS c000000002043a58 2053a58 000690 00 A 0 0 4
> [27] .init.text PROGBITS c000000003000000 3010000 0b0000 00 WAX 0 0 32
> [28] .exit.text PROGBITS c0000000030b0000 30c0000 004158 00 AX 0 0 32
> [29] .init.data PROGBITS c0000000030c0000 30d0000 1c4580 00 WA 0 0 65536
> [30] __ftr_fixup PROGBITS c000000003284580 3294580 00eaf0 00 A 0 0 8
> [31] __mmu_ftr_fixup PROGBITS c000000003293070 32a3070 001830 00 A 0 0 8
> [32] __lwsync_fixup PROGBITS c0000000032948a0 32a48a0 000dc8 00 A 0 0 4
> [33] .data..percpu PROGBITS c0000000032a0000 32b0000 1e0e58 00 WA 0 0 4096
> [34] .machine.desc PROGBITS c000000003480e58 3490e58 000410 00 WA 0 0 8
> [35] .dynsym DYNSYM c000000003481268 3491268 000048 18 A 36 3 8
> [36] .dynstr STRTAB c0000000034812b0 34912b0 000001 00 A 0 0 1
> [37] .dynamic DYNAMIC c0000000034812b8 34912b8 000120 10 WA 36 0 8
> [38] .gnu.hash GNU_HASH c0000000034813d8 34913d8 00001c 00 A 35 0 8
> [39] .rela.dyn RELA c0000000034813f8 34913f8 519030 18 A 35 0 8
> [40] .data PROGBITS c0000000039a0000 39b0000 610100 00 WA 0 0 128
> [41] .data..init_task NOBITS c000000003fb4000 3fc0100 004000 00 WA 0 0 1
> [42] .data..page_aligned PROGBITS c000000003fc0000 3fd0000 010000 00 WA 0 0 65536
> [43] .data..cacheline_aligned PROGBITS c000000003fd0000 3fe0000 023500 00 WA 0 0 128
> [44] .data..read_mostly PROGBITS c000000003ff3500 4003500 03cb80 00 WA 0 0 128
> [45] .data_nosave PROGBITS c000000004040000 407bcec 000000 00 W 0 0 1
> [46] __bug_table PROGBITS c000000004040000 4050000 02bcec 00 WA 0 0 1
> [47] .bss NOBITS c000000004070000 407bcec 725338 00 WA 0 0 65536
> [48] .debug_aranges PROGBITS 0000000000000000 407bcf0 0279d0 00 0 0 16
> [49] .debug_info PROGBITS 0000000000000000 40a36c0 fa4d575 00 0 0 1
> [50] .debug_abbrev PROGBITS 0000000000000000 13af0c35 673114 00 0 0 1
> [51] .debug_line PROGBITS 0000000000000000 14163d49 211a8e7 00 0 0 1
> [52] .debug_frame PROGBITS 0000000000000000 1627e630 3ba1f8 00 0 0 8
> [53] .debug_str PROGBITS 0000000000000000 16638828 426e36 01 MS 0 0 1
> [54] .debug_line_str PROGBITS 0000000000000000 16a5f65e 0004f5 01 MS 0 0 1
> [55] .debug_loclists PROGBITS 0000000000000000 16a5fb53 1efdaf5 00 0 0 1
> [56] .debug_rnglists PROGBITS 0000000000000000 1895d648 4d9186 00 0 0 1
> [57] .comment PROGBITS 0000000000000000 18e367ce 00002e 01 MS 0 0 1
> [58] .symtab SYMTAB 0000000000000000 18e36800 42b670 18 59 150524 8
> [59] .strtab STRTAB 0000000000000000 19261e70 379870 00 0 0 1
> [60] .shstrtab STRTAB 0000000000000000 195db6e0 000302 00 0 0 1
> Key to Flags:
> W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
> L (link order), O (extra OS processing required), G (group), T (TLS),
> C (compressed), x (unknown), o (OS specific), E (exclude),
> D (mbind), p (processor specific)'
>
> > to see what line it's failing at?
> >
>
> As you can see, the last executed line line is
>
> ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p')
> which it self is called from run_readelf
>
> since sed -o errexit is set in the script, sed returns an non-zero error
> and that causes the script to exit if the line is not found.
Hm... since it's a silent failure it really seems like a pipefail.
Can you run "echo $" immediately after the script to get the exit code?
And then after that, change the ELF_SECHEADERS line to:
ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p'; echo "PIPESTATUS=${PIPESTATUS[*]} SHELLOPTS=$SHELLOPTS" >&2)
and then run again and see what is shown for PIPESTATUS and SHELLOPTS.
--
Josh
next prev parent reply other threads:[~2026-12-03 4:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 1:24 Srikar Dronamraju
2026-09-14 19:00 ` Josh Poimboeuf
2026-09-15 2:15 ` Srikar Dronamraju
2026-09-23 9:26 ` Srikar Dronamraju
2026-11-25 15:47 ` Srikar Dronamraju
2026-12-02 23:27 ` Josh Poimboeuf
2026-12-03 2:37 ` Srikar Dronamraju
2026-12-03 4:49 ` Josh Poimboeuf [this message]
2026-12-03 6:46 ` Srikar Dronamraju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axDyXQcsAIA7O7v9@jpoimboe \
--to=jpoimboe@kernel.org \
--cc=bjohannesmeyer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=srikar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®