[PATCH,PE-COFF,PR11603] Allow ld to export symbols containing dots from DLLs.

Doug Semler dougsemler@gmail.com
Mon May 17 16:31:00 GMT 2010

On Mon, May 17, 2010 at 12:46 PM, Dave Korn <dave.korn.cygwin@gmail.com> wrote:
> On 17/05/2010 17:15, Doug Semler wrote:
>> Dave I did a test on x86_64-w64 and it's not exporting the data
>> symbols from the DLLs.  I'm not sure whether it's another underscoring
>> issue or a PEBKAC error but I'm investigating...i'll know more in a
>> little while...
>  Simple test case, by any chance?

Yeah.  Looks like gcc (4.5) isn't generating a correct .drective if
there are both thread local data and exported functions in the same
module.  If I take the __thread off, it exports both.  If I get rid of
the function definition it exports i properly.

__thread __declspec(dllexport) int i;
__declspec(dllexport) int function() { return 42; }


        .file   "foo.c"
.globl __emutls_v.i
        .align 32
        .quad   4
        .quad   4
        .quad   0
        .quad   0
.globl function
        .def    function;       .scl    2;      .type   32;     .endef
        pushq   %rbp
        movq    %rsp, %rbp
        movl    $42, %eax
        .section .drectve
        .ascii " -export:function"

More information about the Binutils mailing list