This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [LTO]: Handle DW_form_ref_addr


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;

        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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]