Re: [PATCH v2 03/19] gendwarfksyms: Add address matching

From: Masahiro Yamada
Date: Sun Sep 01 2024 - 07:11:21 EST


On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:
>
> The compiler may choose not to emit type information in DWARF for all
> aliases, but it's possible for each alias to be exported separately.
> To ensure we find type information for the aliases as well, read
> {section, address} tuples from the symbol table and match symbols also
> by address.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
> ---

> +
> +static int set_symbol_addr(struct symbol *sym, void *arg)
> +{
> + struct symbol_addr *addr = arg;
> +
> + if (sym->addr.section == SHN_UNDEF) {
> + sym->addr.section = addr->section;
> + sym->addr.address = addr->address;


These two lines can be replaced with

sym->addr = *addr;





--
Best Regards
Masahiro Yamada