Re: [PATCH V2] libelf/elf_end.c: check data_list.data.d.d_buf before free it

2018-08-30 Thread Robert Yang
On 08/31/2018 03:57 AM, Mark Wielaard wrote: On Wed, Aug 29, 2018 at 04:53:20PM +0800, Robert Yang wrote: The one which actually saves the data is data_list.data.d.d_buf, so check it before free rawdata_base. This can fix a segmentation fault when prelink libqb_1.0.3: prelink: /usr/lib/libqb

Re: [PATCH V2] libelf/elf_end.c: check data_list.data.d.d_buf before free it

2018-08-30 Thread Mark Wielaard
On Wed, Aug 29, 2018 at 04:53:20PM +0800, Robert Yang wrote: > The one which actually saves the data is data_list.data.d.d_buf, so check it > before free rawdata_base. > > This can fix a segmentation fault when prelink libqb_1.0.3: > prelink: /usr/lib/libqb.so.0.18.2: Symbol section index outside

Re: Accessing String Table Indexes for .rodata

2018-08-30 Thread Mark Wielaard
On Tue, Aug 21, 2018 at 12:16:09AM +0800, Henry C wrote: > Tho, I have no clue how to get the index to each of the string in the > string table above. The .rodata section isn't just a simple ELF string table. Otherwise you could use elf_strptr (see libelf.h) to index through them. But .rodata also

Re: tests/backtrace-dwarf.c failure due to -freorder-blocks-and-partition

2018-08-30 Thread Mark Wielaard
Hi Martin, Sorry for dropping this after you provided such an excellent analysis. So the problem really is that main gets split into main.cold which is jumped into, so a simple backtrace won't see the "hot" main anymore. If we would use the debuginfo we might be able to get the "correct" function

Re: [PATCH] RFC: strip with mixed allocated/non-allocated sections

2018-08-30 Thread Mark Wielaard
On Mon, 2018-07-30 at 00:35 +0200, Mark Wielaard wrote: > Normally in non-ET_REL files all allocated sections come before > all non-allocated sections. eu-strip relies on this when stripping > a file and calculating the file offsets. But recently on Fedora > there are non-allocated .gnu.build.attri