This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shared objects .init section not executed !?



    Andreas> You shouldn't use ld -shared.  Please try gcc -shared.

    Torsten> Ah, thanks ! I was digging into the internals using a bottom-up
    Torsten> approach, and the "ld -shared crtbeginS.o ..." _seemed_ to work,
    Torsten> but really didn't. I was missing crti.o & crtn.o .
** ^
    Andreas> As usual :-(.  ld -shared is not expected to work for the normal
    Andreas> user!

You mean you have to be root or something ;-) ?

    Andreas> Does it work with gcc -shared now?  If not, please resend the
    Andreas> attachment so that others can look into it.

Yes, that was implied by the ** "Ah, thanks!" above. Exactly the crti and
crtn makes it work. Now I'm getting

(.../)ld: internal error ../../ld/ldlang.c 3607

with "gcc ... -Wl,--whole-archive lib_pic.a" which is of course not a glibc
problem. Replacing the --whole-archive and lib_pic.a with the plain object
works.

Anyway, for those interested:

test case


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]