Max - see below... Please note that this same source file compiled and worked just fine on a sparc machine.
William Reich wrote: > > I am trying to compile a dmod for mdb > using gcc on a 64bit x86 machine. > > The compile goes ok, but the resulting file does not load into mdb. > > Anybody know the solution to this puzzle ? > > thanks > > wr > > ++++++++++++ > > > /bin/gcc -L/vob/signalware/Master/library -m64 -fno-builtin > -DOMNI_UNIX \ > -D_KERNEL -DMP_SSRV4 -mno-red-zone \ -mcmodel=kernel -DAMD64_ARCH > -DSOL10 \ > -I/vob/common/src \ > -Wall -std=gnu99 -O -G -o mr_mdb.so mr_mdb.c > > > > # mdb -k > Loading modules: [ unix krtld genunix specfs dtrace cpu.generic > cpu_ms.AuthenticAMD.15 uppc pcplusmp ufs mpt ip hook neti sctp a rp > usba fcp fctl nca lofs md cpc random crypto zfs fcip logindmux ptm > sppp nfs ipc ] > >> ::load ./mr_mdb.so > mdb: ld.so.1: mdb: fatal: relocation error: R_AMD64_PC32: file > ./mr_mdb.so: symbol main: value 0x28001df8e34 does not fit -----Original Message----- From: max at bruningsystems.com [mailto:m...@bruningsystems.com] Sent: Thursday, February 19, 2009 1:01 PM To: William Reich Cc: Bhaskar.Sarkar at Sun.COM; mdb-discuss at opensolaris.org; Richmond Tuttle Subject: Re: [mdb-discuss] mdb dmod - compile with gcc on x86 ? Hi William, William Reich wrote: > > my source does not contain a function named main(). > > ...only has the external function _mdb_init(). > All other functions in the file are static. > > What options are you passing to the compiler, and how are you creating the .so file? What happens when you ::load the file? max