On Thu, Feb 19, 2009 at 12:08:55PM -0500, Bhaskar Sarkar wrote:
> 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
> You should not have a main() function in your module.
> Your only interface to mdb is via _mdb_init()
> 
> HIH,
> Bhaskar
> 
> >
> >++++++++++++
> >
> >
> >/bin/gcc    -L/vob/signalware/Master/library -m64 -fno-builtin
> >-DOMNI_UNIX \
> > -D_KERNEL -DMP_SSRV4  -mno-red-zone \
                          ^^^^^^^^^^^^^
> > -mcmodel=kernel -DAMD64_ARCH -DSOL10 \
    ^^^^^^^^^^^^^^^

Those are your problem;  this isn't a kernel module, so why are you using the
kernel model?

Cheers,
- jonathan

> >  -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
> >_______________________________________________
> >mdb-discuss mailing list
> >mdb-discuss at opensolaris.org
> 
> _______________________________________________
> mdb-discuss mailing list
> mdb-discuss at opensolaris.org

Reply via email to