I've been using this linker line so far,
ld -dy -N driver2 -r driver2.o -o driver2

Upon your suggestion I modified this to
ld -dy -N driver2 -N misc/scsi -r driver2.o -o driver2

In spite of this I'm getting errors after loading the driver. It isn't able to 
attach because the scsi symbols aren't being resolved.

Any other tricks? Is misc/scsi supposed to be in the /kernel/drv directory or 
something? Because I don't have it there.

Regards,
Bhaskar.


-----Original Message-----
From: cas...@holland.sun.com [mailto:cas...@holland.sun.com] On Behalf Of 
casper....@sun.com
Sent: Friday, August 28, 2009 5:12 PM
To: Jayaraman, Bhaskar
Cc: opensolaris-code@opensolaris.org
Subject: Re: [osol-code] Exporting solaris symbols from driver! 



>Hi I have two loadable modules and one of them depends on the other for some 
>symbols. I'm using
>ld -N driver1 -o driver2 driver2.o
>to resolve the symbol, but when I do so I'm unable to attach driver2 because 
>it is unable to resol
ve symbols for scsi_hba_tran_alloc etc. and related API's exported by the 
transport layer.
>
>Is there a way to export symbols from one module globally in solaris?

You'll need to link with the other device driver:

        ld -dy -Nmisc/scsi

        -dy             - force dynamic linking
        -Nmisc/scsi     - add "misc/scsi" as a dependency

Casper



        

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to