10-03-04 02:13 AM
In article <cjjtqc$dji$1@yin.interaccess.com>,
gazelle@yin.interaccess.com (Kenny McCormack) wrote:
> In article <m3d607424a.fsf@salmon.parasoft.com>,
> Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote:
>
> Noted.
>
>
> OK - so far so good. Care to say more?
> Are these environment variables of some sort?
No, they're more like things the dynamic linker needs to know in order to
operate -- the full path to the executable, the platform name, the
location of the program header for the executable invoked, the location
of the start symbol for the executable, the location of the dynamic
linker itself, and flags for hardware capabilities the system supports.
For example, for a ksh shell on my sparcv9 Sun Blade 2500, the auxv
looks like:
$ pargs -x $$
195135: ksh
AT_SUN_PLATFORM 0xffbfffd8 SUNW,Sun-Blade-2500
AT_SUN_EXECNAME 0xffbfffec /usr/bin/ksh
AT_PHDR 0x00010034
AT_PHENT 0x00000020
AT_PHNUM 0x00000006
AT_ENTRY 0x00016944
AT_SUN_LDDATA 0xff3ec000
AT_BASE 0xff3b0000
AT_FLAGS 0x00000b00
AT_PAGESZ 0x00002000
AT_SUN_AUXFLAGS 0x00000002
AT_SUN_HWCAP 0x0000006b VIS2 | VIS | V8PLUS | DIV32 | MUL32
and the address space of the process looks like:
$ pmap $$
195135: ksh
00010000 200K r-x-- /usr/bin/ksh
00052000 8K rwx-- /usr/bin/ksh
00054000 40K rwx-- [ heap ]
FF276000 8K rwxs- [ anon ]
FF280000 864K r-x-- /lib/libc.so.1
FF368000 32K rwx-- /lib/libc.so.1
FF370000 8K rwx-- /lib/libc.so.1
FF380000 8K r-x-- /platform/sun4u-us3/lib/libc_psr.so.1
FF390000 64K rwx-- [ anon ]
FF3B0000 176K r-x-- /lib/ld.so.1
FF3EC000 8K rwx-- /lib/ld.so.1
FF3EE000 8K rwx-- /lib/ld.so.1
FFBFC000 16K rw--- [ stack ]
total 1440K
Notice that the "AT_PHDR" (program header) points near the beginning of
the text segment of the KSH binary (right after the main ELF header,
actually), AT_BASE points at the base of the dynamic linker (ld.so.1)
and AT_SUN_LDDATA points to the beginning of the dynamic linker's data
segment.
You can look at /usr/include/sys/auxv.h for the definitions of (and a
small amount of descriptive text about) the AT_* flags.
- jonathan
[ Post a follow-up to this message ]
|