bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/2300] New: ld does not report duplicate symbols defined in scrip


From: raj dot khem at gmail dot com
Subject: [Bug ld/2300] New: ld does not report duplicate symbols defined in script file
Date: 8 Feb 2006 18:02:42 -0000

In the following example symbol _start should have been reported as duplicate as
there are two instances of it. But ld does not report this error and the _start
symbol defined in duplicate.o file is overridden.

example

Sampel application "duplicate.c":
  extern int dummy(void)
  {
      volatile int i;

      /* create some .text data to move _start away from the beginning */

      for(i = 0; i < 100; i++)
          ;

      return i;
  }

  extern void _start(void)
  {
      volatile int *p = (volatile int*)0xbf0c0000;

      *p = dummy();
  }

Linker script "duplicate-ld":
  SECTIONS
  {
      .text 0x00000000:
      {
          _start = . ;
          *(.text)
      }
  } 



How to reproduce 

gcc -c -o duplicate.o duplicate.c
ld -o duplicate -T duplicate-ld duplicate.o

-- 
           Summary: ld does not report duplicate symbols defined in script
                    file
           Product: binutils
           Version: 2.17 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: raj dot khem at gmail dot com
                CC: bug-binutils at gnu dot org,hjl at lucon dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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

------- 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]