Page MenuHomeFreeBSD

Make elf_aux_info() as public libc function.
ClosedPublic

Authored by mmel on Oct 20 2017, 1:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 22 2024, 1:06 PM
Unknown Object (File)
Nov 21 2024, 7:21 AM
Unknown Object (File)
Nov 20 2024, 10:01 AM
Unknown Object (File)
Nov 19 2024, 12:07 PM
Unknown Object (File)
Nov 19 2024, 7:42 AM
Unknown Object (File)
Nov 10 2024, 10:04 PM
Unknown Object (File)
Nov 8 2024, 11:22 AM
Unknown Object (File)
Nov 8 2024, 5:59 AM
Subscribers

Details

Summary
  • Teach elf aux vector functions about newly added AT_HWCAP ATHWCAP2 vectors.
  • Export _elf_aux_info() as new public libc function elf_aux_info(3)

The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc
getauxval() with more robust interface.

Note:
We cannot name this new function as getauxval(), with glibc compatible
interface. Some ports autodetect its existence and then expects that all
Linux specific AT_<*> vectors are defined and implemented.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks mostly fine, but is not committable because AT_HWCAP2 is not defined.

Does it make sense to include machine/elf.h from auxv.h ? Why not make it a user duty ?

Would be nice to provide some kind of man page.

This revision is now accepted and ready to land.Oct 20 2017, 2:10 PM
sys/sys/auxv.h
35 ↗(On Diff #34180)

You need to brace the function declaration into BEGIN_DECLS/END_DECLS to make it usable for C++.

In D12743#264414, @kib wrote:

Does it make sense to include machine/elf.h from auxv.h ? Why not make it a user duty ?

Imho yes, AT_ values are defined in machine/elf.h so user should include it in (almost) all cases.

Would be nice to provide some kind of man page.

I will ask Ian for man page, this kind of job is significantly out of my skill (even in my native language). My bad I known.

sys/sys/auxv.h
35 ↗(On Diff #34180)

Ahh, yes, sure. I will do it.

This revision was automatically updated to reflect the committed changes.