Article View: gnu.gcc.help
Article #53139** GCC symbol types ?? **
From: Laurent Julliard - HP Grenoble N...
Date: Wed, 11 Mar 1992 07:51
Date: Wed, 11 Mar 1992 07:51
70 lines
2931 bytes
2931 bytes
Hello,
My name is Laurent JULLIARD, working as a Software Engineer at Hewlett
Packard Company. I'm currently in the process of writing a tool that will
allow us to transform a GCC object file (.o) into a compatible HP_UX object
file.
This tool is exactly the reverse of a tool (called hpxt) distributed by
the FSF in HP_UX implementation of GCC. Of course I didn't rewrite the all
stuff from scratch because "hpxt" was a good starting point.
However there are some strange things in the symbol table that I can not
explain from the information I have in hpxt. It would be very kind of you if
you could help me to sort out the following problems :
Here is the structure of a symbol table entry (with the known value for
the field "n_type" :
>----------------------------------------------------------<
struct gnu_nlist
{
union
{
char *n_name; /* for use when in-core */
long n_strx; /* index into file string table */
} n_un;
unsigned char n_type; /* type flag (N_TEXT,..) */
char n_other; /* unused */
short n_desc; /* see <stab.h> */
unsigned long n_value; /* value of symbol (or sdb offset) */
};
#define GNU_SYMTYPE_UNDEFINED 0x0
#define GNU_SYMTYPE_ABSOLUTE 0x2
#define GNU_SYMTYPE_TEXT 0x4
#define GNU_SYMTYPE_DATA 0x6
#define GNU_SYMTYPE_BSS 0x8
#define GNU_SYMTYPE_COMMON 0x12
#define GNU_SYMTYPE_FILENAME 0x1F
#define GNU_SYMTYPE_EXTERNAL 0x01
>----------------------------------------------------------<
PROBLEM #1 : Some entries have their index set to 0 (field n_strx = 0).
What is the purpose of such entries ? (Remark : the n_desc,
n_value and n_type fields are not null)
PROBLEM #2 : Some entries have their type flag set to "none documented"
values such as :
. 0x64, 0x44, 0x24
and
. 0x80, 0xC0, 0xE0
What are they ? Are they (respectively) GNU_SYMTYPE_TEXT and
GNU_SYMTYPE_UNDEFINED with an additional info into the upper
nibble ?
NOTE : I'm using GCC 1.40.
I thank you very much for your help.
Best regards,
Laurent JULLIARD
HP GND Lab / (Grenoble - FRANCE)
laurentj@hpgnse2.grenoble.hp.com
P.S. : GCC is really a nice piece of code !
Technical Details
Message-ID:
<9203110751.AA08097@hpgnse2.grenoble.hp.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!hpgnse2.grenoble.hp.com!laurentjShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,fbc36b82e0cbcbf9,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-03-11 00:35:56 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!hpgnse2.grenoble.hp.com!laurentj From: laurentj@hpgnse2.grenoble.hp.com (Laurent Julliard - HP Grenoble Network Division) Subject: ** GCC symbol types ?? ** Message-ID: <9203110751.AA08097@hpgnse2.grenoble.hp.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 11 Mar 1992 07:51:03 GMT Lines: 71