Hi, On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel wrote: > - > +#ifndef __OPTIMIZE__ > unsigned int > dwarf_whatattr (Dwarf_Attribute *attr) > { > return attr == NULL ? 0 : attr->code; > } > +#endif > diff --git a/libdw/dwarf_whatform.c b/libdw/dwarf_whatform.c > index dee29a9f..01a33424 100644 > --- a/libdw/dwarf_whatform.c > +++ b/libdw/dwarf_whatform.c > @@ -34,9 +34,10 @@ > #include <dwarf.h> > #include "libdwP.h" > > - > +#ifndef __OPTIMIZE__ > unsigned int > dwarf_whatform (Dwarf_Attribute *attr) > { > return attr == NULL ? 0 : attr->form; > } > +#endif
I don't think this is correct. These functions are defined with extern inline (if __OPTIMIZE__ is defined). Which means they will not generate an out-of-line version. But these functions are exported from libdw, so there must be a real implementation. So we want to generate code for these functions whether or not __OPTIMIZE__ is defined. Cheers, Mark