bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/9687] New: Weak symbols not working on mingw32


From: tcl_de at gmx dot net
Subject: [Bug ld/9687] New: Weak symbols not working on mingw32
Date: 27 Dec 2008 13:47:28 -0000

Using
>GNU assembler (GNU Binutils) 2.19
>Copyright 2007 Free Software Foundation, Inc.
>This program is free software; you may redistribute it under the terms of
>the GNU General Public License version 3 or later.
>This program has absolutely no warranty.
>This assembler was configured for a target of `mingw32'.
and corresponding GNU ld I get the following output running gcc 4.3 rev 142914:
>W:/WINDOWS/TMP/cc1R156y.o:main.c:(.text+0x17): undefined reference to 
>`function'
>collect2: ld returned 1 exit status
when compiling the following to files:
================== main.c =================
extern void function();

int main()
{
    function();
        return 0;
}
================== weak.c =================
#include <stdio.h>

void __attribute__((weak)) function()
{
    printf("Hello from the weak function\n");
}

======== Asm code of weak.c after being processed by gcc ========
        .file   "weak.c"
        .section .rdata,"dr"
LC0:
        .ascii "Hello from the weak function\0"
        .text
        .weak   _function
        .def    _function;      .scl    2;      .type   32;     .endef
_function:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    $LC0, (%esp)
        call    _puts
        leave
        ret
        .def    _puts;  .scl    2;      .type   32;     .endef
===================================================
This means as far as I can tell that either ld does not find the weak symbol or
that as does not correctly save the weak symbol in the PE File.

-- 
           Summary: Weak symbols not working on mingw32
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: tcl_de at gmx dot net
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=9687

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]