This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix libbacktrace on prelinked shared libraries
- From: Ian Lance Taylor <iant at google dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Nov 2013 08:29:05 -0800
- Subject: Re: [PATCH] Fix libbacktrace on prelinked shared libraries
- Authentication-results: sourceware.org; auth=none
- References: <20131118131147 dot GZ892 at tucnak dot redhat dot com>
On Mon, Nov 18, 2013 at 5:11 AM, Jakub Jelinek <email@example.com> wrote:
> info->dlpi_addr == 0 is true for executables (but those have also
> info->dlpi_name set to ""), but not just for those, it is true also
> for successfully prelinked shared libraries or any other libraries that
> have been linked at non-zero offset and the dynamic linker managed to mmap
> them where they were prelinked resp. linked to.
> BTW, I'm surprised you aren't adding base_address (well, in fact it is
> actually not base address, but load bias, difference between load address
> and link base address) to elf_initialize_syminfo created symbol addresses,
> because all of them should be biased by the load address.
> And, elf_initialize_syminfo should ignore st_shndx == SHN_UNDEF symbols,
> those shouldn't be biased but not even entered into the table.
You're right, these are bugs.
> 2013-11-18 Jakub Jelinek <firstname.lastname@example.org>
> * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
This is OK.