Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

New no-leading-underscore

2010-04-16
2013-06-06
  • Doug Semler
    Doug Semler
    2010-04-16

    Does anyone have a new 64 bit build with the no-leading-underscore option enabled in the toolchain on hand?

    I'm trying to figure out if I've regressed my copy.  I'm having problems when no leading underscore is enabled during auto-import of data fixups and I want to make sure it's not my fault.  My ld is crashing with a segfault…

    Simple test:
    dlldata.c
    __declspec(dllexport) int dlldata = 42;

    main.c
    /* don't dllimport this */
    extern int dlldata;

    int main() { return dlldata; }

    --
    (assume no leading underscore crt)
    compile the dlldata.c with gcc -m64 -fno-leading-underscore -shared -o libdlldata.dll -Wl,-out-implib,libdlldata.dll.a
    compile the main.c with gcc -m64 -fno-leading-underscore -o main.exe main.c -L. -ldlldata -Wl,-no-leading-underscore

    I get a crash in ld - and I think it's during the fixup reloc of the autoimport of __imp_dlldata (the reloc to _nm_dlldata).  Can anyone verify?

    Thanks,
    Doug

     
  • Kai Tietz
    Kai Tietz
    2010-04-17

    No, I have the same issue. In coffcode.h (in bfd/coffcode.h:2651) q->sym_ptr_ptr has value NULL and therefore we see a segmentation fault.

    Kai

     
  • Doug Semler
    Doug Semler
    2010-04-17

    OK - thanks Kai…that makes me fell a little better :) (Yeah, same spot that I saw)

    Guessing that there's a disconnect between what ld is looking for and what is in the symbol table but I'll try ginning up a debug build and stepping through it…