ABI document

Florian Weimer fweimer@redhat.com
Mon Sep 21 12:36:45 GMT 2020


* Vivek Das Mohapatra:

>> I can't tell whether the formatting is okay, and whether we need to add
>> markup (like ``) for program text.
>
> I asked and was told it was more important to get the actual
> content agreed before we worried about that (and tbh the
> content is the hard part).

Makes sense.

Prelinking should reference the documentation from the prelink utility
(attached, if we can't find another URL, we could drop this next to our
text files, or maybe in a subdirectory).

I think the interaction between PT_GNU_RELRO and PT_LOAD is that the
PT_GNU_RELO range must cover virtual addresses previously established by
PT_LOAD segments.

VER_NDX_ELIMINATE is not implemented in glibcs AFAICS, so we can't
reverse-engineer the semantics from there.

The hidden bit in vna_other is used in glibc here:

      else
        {
          /* We can match the version information or use the
             default one if it is not hidden.  */
          ElfW(Half) ndx = verstab[symidx] & 0x7fff;
          if ((map->l_versions[ndx].hash != version->hash
               || strcmp (map->l_versions[ndx].name, version->name))
              && (version->hidden || map->l_versions[ndx].hash
                  || (verstab[symidx] & 0x8000)))
            /* It's not the version we want.  */
            return NULL;
        }

I'm not entirely sure what it means, sorry.  The negated conditional
reads like this:

  (map->l_versions[ndx].hash == version->hash
   && strcmp (map->l_versions[ndx].name, version->name) == 0)
  || (!version->hidden
      && map->l_versions[ndx].hash == 0
      && (verstab[symidx] & 0x8000) == 0)

So it basically says, if the version matches *or* the lookup permits
matching an unversioned symbol, then the lookup succeeds.  I used it for
looking up the malloc symbol (which can be unversioned if interposed) in
ld.so, but I'm not sure if there are any other actual users.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prelink.pdf
Type: application/pdf
Size: 539486 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gnu-gabi/attachments/20200921/20fff38f/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prelink.tex
Type: application/x-tex
Size: 197978 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gnu-gabi/attachments/20200921/20fff38f/attachment-0001.tex>


More information about the Gnu-gabi mailing list