Hi Guys,

  I have encountered a discrepancy between GNU LD and GOLD with regard to the
PROVIDE keyword.  If the provided symbol is not referenced in an input object
file then GOLD will not define it, even if it is referenced elsewhere in the
linker script.

  To reproduce follow these steps:

  % touch empty.c
  % gcc -c empty.c
  % cat <<EOF >provide.ld
  SECTIONS
  {
        PROVIDE (foo = 0);

        .bar :
        {
        LONG (foo);
        }
  }
  EOF

  % ld -T provide.ld empty.o
  % gold -T provide.ld empty.o
  gold: error: undefined symbol 'foo' referenced in expression

Cheers
  Nick

-- 
           Summary: GOLD: PROVIDE: does not provide symbols only referenced
                    in linker script
           Product: binutils
           Version: 2.21 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: nickc at redhat dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


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

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

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

Reply via email to