On Fri, 6 Nov 2026 13:13:40 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> Currently SA would find Build ID from `SHT_NOTE` to load debuginfo file. 
>> However it does not work in some case for example, ELF binaries which does 
>> not have `.note.gnu.build-id`section. I see this case in vDSO (vdso64.so) in 
>> Linux Kernel 7.2.15-300.fc45.x86_64. This file can be handled in 
>> `debuginfod-find` - it can identify Build ID, and can download appropriate 
>> debuginfo file, but SA cannot identify it.
>> 
>> It might not be a common case, but we can create such ELF binaries with 
>> `strip -R .note.gnu.build-id`, and it works. So it is better to support such 
>> binaries in SA. In this case, the Build ID note is accessible through a 
>> `PT_NOTE` program header, even though there is no corresponding 
>> `.note.gnu.build-id` section. This change makes SA scan the notes in 
>> `PT_NOTE` segments instead of relying on `SHT_NOTE` section headers to 
>> obtain the Build ID.
>> 
>> SA already supports debuginfo, but test code is not available. So this PR 
>> adds it.
>> We need to separate debuginfo from native library and strip it, so I 
>> modified related makefiles to do it in force. It works regardless of 
>> `--with-native-debug-symbols` configure option.
>> However we cannot test Build ID because the debuginfo depends on Build ID 
>> should be located at debug directory on host e.g. `/usr/lib/debug`. So the 
>> test introduced by this PR tests to load debug symbols from separated 
>> debuginfo file.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Yasumasa Suenaga has updated the pull request incrementally with four 
> additional commits since the last revision:
> 
>  - Remove blank line
>  - improvement
>  - Fix
>  - Exclude libDebuginfoTest.c from non-Linux platforms

Build change looks ok

-------------

Marked as reviewed by erikj (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/33764#pullrequestreview-5801052047

Reply via email to