Linker Error on Hello
Wang, John (IVV-1800)
john.wang-1 at nasa.gov
Tue Mar 22 21:23:01 UTC 2016
Anyone know how I can fix this linker error?
/opt/rtems-4.10/bin/sparc-rtems-gcc -g -n hello.exe > hello.num
hello.exe: In function `data_start':
(.data+0x4): multiple definition of `__dso_handle'
/opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/crtbegin.o:(.data+0x4): first defined here
hello.exe: In function `_init':
(.text+0x1e4d8): multiple definition of `_init'
/opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/crti.o:(.init+0x0): first defined here
hello.exe: In function `BSP_fatal_return':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:339: multiple definition of `BSP_fatal_return'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:339: first defined here
hello.exe: In function `CLOCK_SPEED':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: multiple definition of `CLOCK_SPEED'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: first defined here
hello.exe: In function `rdb_start':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: multiple definition of `_ERC32_MEC_Timer_Control_Mirror'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: first defined here
hello.exe: In function `hard_reset':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:207: multiple definition of `hard_reset'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:207: first defined here
hello.exe: In function `_fini':
(.text+0x1e4f4): multiple definition of `_fini'
/opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/crti.o:(.fini+0x0): first defined here
hello.exe: In function `start':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:58: multiple definition of `trap_table'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:58: first defined here
hello.exe: In function `rdb_start':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: multiple definition of `rdb_start'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:141: first defined here
hello.exe: In function `start':
/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:58: multiple definition of `start'
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:58: first defined here
/opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
hello.exe:(.text+0x1c82c): first defined here
collect2: ld returned 1 exit status
make[5]: *** [hello.exe] Error 1
make[5]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites/samples/hello'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites/samples'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c'
make: *** [all-recursive] Error 1
________________________________
From: Joel Sherrill [joel at rtems.org]
Sent: Tuesday, March 22, 2016 11:35 AM
To: Wang, John (IVV-1800)
Cc: rtems-users at rtems.org
Subject: Re: collect2: ld returned 1 exit status
On Mon, Mar 21, 2016 at 11:21 PM, Wang, John (IVV-1800) <john.wang-1 at nasa.gov<mailto:john.wang-1 at nasa.gov>> wrote:
Hi,
I fixed the NM variable issue with compiling Hello for SPARC RTEMS. Now I believe I have a linker issue.
/opt/rtems-4.10/sparc-rtems/leon3/lib/start.o:/opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/../../sparc/shared/start.S:58: first defined here
/opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
hello.exe:(.text+0x1c83c): first defined here
I don't think __DTOR_END__ has ever been declared in a start.S on any version of RTEMS for
any architecture. It is not in the start.S on the 4.10 branch of the community version. I have no
idea who added that to your version.
Do you have enough local history to see what happened?
collect2: ld returned 1 exit status
make[5]: *** [hello.exe] Error 1
make[5]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites/samples/hello'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites/samples'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3/testsuites'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c/leon3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/rtems-4.10build/sparc-rtems4.10/c'
make: *** [all-recursive] Error 1
Any ideas? Can someone help with this?
thanks
John
_______________________________________________
users mailing list
users at rtems.org<mailto:users at rtems.org>
http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160322/c3722f78/attachment.html>
More information about the users
mailing list