This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO]: Handle DW_form_ref_addr
- From: Michael Matz <matz at suse dot de>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 10 Jul 2006 07:35:28 +0200 (CEST)
- Subject: Re: [LTO]: Handle DW_form_ref_addr
- References: <44A7F2D7.3020202@dberlin.org>
Hi,
On Sun, 2 Jul 2006, Daniel Berlin wrote:
> So, first, I just wanted to point out that the libelf 0.8.5 I found
> included in my OpenSUSE 10.1 distro (and the web), and Ubuntu, doesn't
> include "elf_getshstrndx" (all other functions are there).
Was included only in later Solaris releases it seems, and the libelf
author aims for compatibility with that one. He now added that function
and elf_getshnum(), which also was missing. Unfortunately there is an
incompatibility between the Solaris manpages and implementation between
Solaris 10 and Solaris Express (where the manpages are believed to be
wrong from the start): In Solaris 10 it returned -1 on error, and under
Solaris Express they return 0 on error and 1 if all went right (how ugly
that sounds).
There's a simple trick to differentiate between both implementations:
size_t bla;
elf_version(EV_CURRENT);
if (elf_getshnum(NULL, &bla) == 0) {
/* Solaris Express or libelf 0.8.8 onwards */
}
else {
/* Solaris 10, Dreppers libelf or libelf 0.8.7 */
}
So, we can simply require libelf 0.8.8 at least and be done with that.
See http://www.mr511.de/software/
Ciao,
Michael.