Re: incorrect signed data

2014-02-05 Thread Josh Stone
On 02/05/2014 09:36 AM, Josh Stone wrote: > On 02/05/2014 03:44 AM, Mark Wielaard wrote: >> On Tue, 2014-02-04 at 18:24 -0800, Josh Stone wrote: >>> So now I'm not sure anything needs to change. At least dwarf_formsdata >>> should stay as-is for gcc. >> >> Are you sure? I think your original analy

Re: [PATCH] libdw: Read DW_AT_decl_file/line/column as unsigned

2014-02-05 Thread Josh Stone
On 02/05/2014 11:58 AM, Josh Stone wrote: > Also, an assertion on the range of line/column is now a handled error, > setting DWARF_E_INVALID_DWARF for values greater than INT_MAX. Note, this is not so much INVALID as UNSUPPORTED, really, as the current API can only deal with int values. I still t

[PATCH] libdw: Read DW_AT_decl_file/line/column as unsigned

2014-02-05 Thread Josh Stone
Section 2.14 of the DWARF v3 & v4 standards specifies that all three declaration coordinates are unsigned integer constants. DWARF v2 did not specify signedness. Now dwarf_decl_* use dwarf_formudata to read these values. Also, an assertion on the range of line/column is now a handled error, sett

Re: incorrect signed data

2014-02-05 Thread Josh Stone
On 02/05/2014 03:44 AM, Mark Wielaard wrote: > On Tue, 2014-02-04 at 18:24 -0800, Josh Stone wrote: >> On 02/04/2014 03:12 PM, Josh Stone wrote: >>> There are only a few internal dwarf_formsdata calls: for the decls as I >>> mentioned, and in array_size() for DW_AT_lower/upper_bound. AFAICS the >>

Make gelf_getphdr more robust?

2014-02-05 Thread Florian Weimer
readelf does this: GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem); … if (phdr->p_type == PT_INTERP) { /* We can show the user the name of the interpreter. */ size_t maxsize; char *filedata = elf_rawfile (ebl->elf, &maxsize); if (

Re: incorrect signed data

2014-02-05 Thread Mark Wielaard
On Tue, 2014-02-04 at 18:24 -0800, Josh Stone wrote: > On 02/04/2014 03:12 PM, Josh Stone wrote: > > There are only a few internal dwarf_formsdata calls: for the decls as I > > mentioned, and in array_size() for DW_AT_lower/upper_bound. AFAICS the > > spec doesn't explicitly call bounds signed or