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


New no-leading-underscore

  • Doug Semler
    Doug Semler

    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:
    __declspec(dllexport) int dlldata = 42;

    /* 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?


  • Kai Tietz
    Kai Tietz

    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.


  • Doug Semler
    Doug Semler

    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…