[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

integers in ELF ???



I need to search an object file for an integer; in other ELF
implementations this has been trivial:

Example: generate eight easily located integers:

#include <sys/types.h>

main()
{
u_int32_t a[8]={305419888,305419889,305419890,305419891,305419892,305419893,305419894,305419895};
}

The hex values of the integers is 0x12345670 -> 0x12345677

Compiled on an Intel SysVR4 _STDC_, ELF box, a hexdump of the object
gives:

00000370  c2 00 00 00 00 00 00 00  70 56 34 12 71 56 34 12 |Â.......pV4.qV4.|
00000380  72 56 34 12 73 56 34 12  74 56 34 12 75 56 34 12 |rV4.sV4.tV4.uV4.|
00000390  76 56 34 12 77 56 34 12  00 00 00 00 00 00 00 00 |vV4.wV4.........|

Compiled on OpenBSD 3.2 sparc (32bit) gcc:

00000470  90 12 62 70 d0 27 bf d8  13 04 8d 15 90 12 62 71 |..bpÐ'¿Ø......bq|
00000480  d0 27 bf dc 13 04 8d 15  90 12 62 72 d0 27 bf e0 |Ð'¿Ü......brÐ'¿à|
00000490  13 04 8d 15 90 12 62 73  d0 27 bf e4 13 04 8d 15 |......bsÐ'¿ä....|
000004a0  90 12 62 74 d0 27 bf e8  13 04 8d 15 90 12 62 75 |..btÐ'¿è......bu|
000004b0  d0 27 bf ec 13 04 8d 15  90 12 62 76 d0 27 bf f0 |Ð'¿ì......bvÐ'¿ð|
000004c0  13 04 8d 15 90 12 62 77  d0 27 bf f4 81 c7 e0 08 |......bwÐ'¿ô.Çà.|

How are integers and shorts represented in the object file? How about
on Solaris 2.x ELF?

I did a reasonable search of documentation before posting.

All replies appreciated.

Michael Grigoni
Cybertheque Museum



Visit your host, monkey.org