Em Mon, Jan 30, 2023 at 10:37:56PM +0000, Alan Maguire escreveu: > On 30/01/2023 20:23, Arnaldo Carvalho de Melo wrote: > > Em Mon, Jan 30, 2023 at 05:10:51PM -0300, Arnaldo Carvalho de Melo escreveu: > >> +++ b/dwarves.h > >> @@ -262,6 +262,7 @@ struct cu { > >> uint8_t has_addr_info:1; > >> uint8_t uses_global_strings:1; > >> uint8_t little_endian:1; > >> + uint8_t nr_register_params; > >> uint16_t language; > >> unsigned long nr_inline_expansions; > >> size_t size_inline_expansions; > > > Thanks for this, never thought of cross-builds to be honest! > Tested just now on x86_64 and aarch64 at my end, just ran > into one small thing on one system; turns out EM_RISCV isn't > defined if using a very old elf.h; below works around this > (dwarves otherwise builds fine on this system). Ok, will add it and will test with containers for older distros too. - Arnaldo > diff --git a/dwarf_loader.c b/dwarf_loader.c > index dba2d37..47a3bc2 100644 > --- a/dwarf_loader.c > +++ b/dwarf_loader.c > @@ -992,6 +992,11 @@ static struct class_member *class_member__new(Dwarf_Die *die, struct cu *c > return member; > } > > +/* for older elf.h */ > +#ifndef EM_RISCV > +#define EM_RISCV 243 > +#endif > + > /* How many function parameters are passed via registers? Used below in > * determining if an argument has been optimized out or if it is simply > * an argument > cu__nr_register_params(). Making cu__nr_register_params() -- - Arnaldo