[PATCH] gas: Mark weak functions as external in DWARF

Longjun Luo luolongjuna@gmail.com
Thu Nov 12 03:24:25 GMT 2026


On Fri, Nov 6, 2026 at 5:00 PM Jan Beulich <jbeulich@suse.com> wrote:
> This part certainly is okay, but ...
>
>> +++ b/gas/testsuite/gas/elf/dwarf-3-func-weak.d
>
> ... what does this new testcase test which ...
>
>> +++ b/gas/testsuite/gas/elf/dwarf-3-func.d
>
> ... this adjustment to the existing one doesn't cover? (Same for the Dwarf5
> ones below then, obviously.)

The mixed tests contain both global and local functions, so have_efunc
and have_lfunc are already set even if out_debug_abbrev() still treats
weak functions as local.

The new tests contain only a weak function, verifying that
out_debug_abbrev() sets have_efunc without setting have_lfunc.  With
have_efunc && !have_lfunc, the DWARF 3 case exercises the
DWARF2_VERSION < 4 (DW_FORM_flag) path, while the DWARF 5 case checks
DW_FORM_flag_present.

So the mixed tests cover the out_debug_info() hunk, and only the new
ones fail without the out_debug_abbrev() hunk (DW_AT_external is then
missing from the abbrev).

Thanks,
Longjun


More information about the Binutils mailing list