https://sourceware.org/bugzilla/show_bug.cgi?id=18745

            Bug ID: 18745
           Summary: --start-lib --end-lib  picks a weak symbol definition
                    ahead of a strong symbol definition
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: tmsriram at google dot com
                CC: ian at airs dot com
  Target Milestone: ---

Is this a bug?

foo.cc

#include <stdio.h>

__attribute__((weak))
int foo() {
  printf("This is weak\n");
}

int main() {
  foo();
}

bar.cc

#include <stdio.h>
int foo() {
  printf("This is strong\n");
}

$ g++ -c foo.cc bar.cc
$ ld.gold --start-lib foo.o bar.o --end-lib  ..
$ ./a.out
This is weak

I would have expected the strong definition to be kept.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to