This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: pmachata/reader_hooks review
- From: Roland McGrath <roland at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 05 May 2009 00:05:41 -0700
- Subject: Re: pmachata/reader_hooks review
> Roland McGrath wrote:
> > * dwarf_formudata needs special treatment.
>
> This is now on the branch. The new function is called
> __libdw_read_udata_address.
"address" does not make sense here--it's an offset that's being relocated.
It should use the read_offset hook internally. I would call it something
like __libdw_formptr, since it's the attribute decoder for "*ptr" classes.
It should not reject the other {u,}data* forms that can't have relocs.
It's not mandatory that relocatable forms be used in a final-link section.
(Our writer will probably use the shortest form in this case.)
I think the bogus offset check case should use DWARF_E_INVALID_DWARF, not
the ERR_NODATA error. Use an unlikely () in any if that leads to a
malformed-data sort of error.
> Doing the above, I found myself looking at dwarf_getmacros. The way
> offsets are handled in this functions strikes me as wrong: macoff is
> read from attribute, and then never used; [...]
Yes, it's wrong. It was never noticed since this was so little used or
tested, and it always happens to work for the first CU in the section so
that trivial test cases don't hit the bug. A test case and fix for that
for the trunk would be good.
> (AFAIK, GNU toolchain doesn't even emit macinfo section).
Use -g3 to request it.
Thanks,
Roland