1 Reply Latest reply: Jan 20, 2009 3:31 PM by 807567 RSS

    undefined symbol '_GLOBAL_OFFSET_TABLE_'

    807567
      I am porting a pseudo driver from Solaris 10 sparc to x86. I have gotten the driver to build completely with Studio 12. When I attempt to run the add_drv command I receive the following error:

      devfsadm: driver failed to attach: mymod
      Warning: Driver (mymod) successfully added to system but failed to attach

      and in the messages log I get:

      Jan 19 14:33:11 earth genunix: [ID 819705 kern.notice] /usr/kernel/drv/amd64/mymod: undefined symbol
      Jan 19 14:33:11 earth genunix: [ID 826211 kern.notice] '_GLOBAL_OFFSET_TABLE_'
      Jan 19 14:33:11 earth genunix: [ID 472681 kern.notice] WARNING: mod_load: cannot load module 'mymod'

      Here is my conf file:

      # cat /usr/kernel/drv/mymod.conf
      name="mymod" parent="pseudo" instance=0;

      The flags I am using to compile the 64bit module are -KPIC -xmodel=medium -D_KERNEL.

      Have I missed something in the linking stage?

      Thanks
        • 1. Re: undefined symbol '_GLOBAL_OFFSET_TABLE_'
          807567
          Hello.

          The reason for this is the -KPIC switch that is definitely wrong.

          I do not know if the -xmodel=medium switch is correct because I compiled only one driver for amd64 (I have more experience on x86/32 and Sparc systems) but as far as I know it should be -xmodel=kernel, not medium.

          Hope this helps.

          Martin