Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-21 Thread Mark Wielaard
On Thu, Dec 21, 2017 at 02:48:15PM +0100, Ulf Hermann wrote: > > yes, but the original code really was not correct. The attached patch > > fixes it by adding an explicit sec_idx field to the Dwarf_CU struct > > that is set whenever a struct Dwarf_CU is created, so that we never > > have to guess. >

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-21 Thread Mark Wielaard
On Thu, Dec 21, 2017 at 02:47:49PM +0100, Ulf Hermann wrote: > > It is surprising we didn't see more issues with this code. There is > > also the fake loc cu that fetches data from a different section. I > > updated both functions as attached. > > Looks good to me. Thanks for taking a look. Pushe

Re: [PATCH] readelf: Try to continue after encountering bogus ELF Note data.

2017-12-21 Thread Mark Wielaard
On Mon, Dec 18, 2017 at 12:41:09PM +0100, Mark Wielaard wrote: > There might be other sections or segments with ELF Notes that are > readable. Also adjust error message depending on whether or not we > actually got any data for the ELF Note segment or section. Pushed to master.

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-21 Thread Ulf Hermann
yes, but the original code really was not correct. The attached patch fixes it by adding an explicit sec_idx field to the Dwarf_CU struct that is set whenever a struct Dwarf_CU is created, so that we never have to guess. This patch combined with the overflow fix makes all testcases PASS. Looks

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-21 Thread Ulf Hermann
It is surprising we didn't see more issues with this code. There is also the fake loc cu that fetches data from a different section. I updated both functions as attached. Looks good to me. Ulf