[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/10322] New: archive:file matching in linker script not working.
From: |
memeruiz at gmail dot com |
Subject: |
[Bug ld/10322] New: archive:file matching in linker script not working. |
Date: |
23 Jun 2009 21:36:09 -0000 |
Conditions: Host computer: Debian sid/i386, Crosscompiling to arm-none-eabi for
a arm Cortex-M3 microcontroller. No target operating system, just a binary to
flash.
- There are two object files which contain some code (interrupt service rutines,
reset rutines, etc): file1.o file2.o
- In file1.o there is a symbol called: __reset_handler which is part of the
.text section
- I create an archive with arm-none-eabi-ar from them with:
arm-none-eabi-ar -rcs libfoo.a file1.o file2.o
- I compile another file called main.c with:
arm-none-eabi-gcc -c $(CFLAGS) -c main.c
- I try to link them together with:
arm-non-eabi-ld -TlinkerS.ld -o bar.elf main.o -lfoo
- The result is that the symbols from the archive are completely ignored, even
if I am using the archive:file convention in the linkerS.ld script.
If I use the option --whole-archive with ld then it works fine. But then it
looks in all the archive files, which I don't want.
Relevant section in the linker script:
SECTIONS
{
.isr_vector :
{
KEEP(libfoo.a:file1.o(.text))
} >FLASH
/* more input sections ...*/
}
Running:
arm-none-eabi-objdump -t bar.elf
gives no __reset_handler symbol
But when I activate --whole-archive then is there.
arm-none-eabi-objdump -t libfoo.a
Gives the __reset_handler symbol inside of the file1.o
I also tried using wildcards but with no results. Nothing happend.
Also if I use the option -y __reset_handler with --whole-archive it shows up,
but without this option the symbol doesn't show up.
I'm not sure if I'm making a mistake somewhere, or if this is really a bug.
I can try out patches if necessary.
Thanks in advance!
Federico Ruiz-Ugalde
--
Summary: archive:file matching in linker script not working.
Product: binutils
Version: 2.19
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: memeruiz at gmail dot com
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=10322
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/10322] New: archive:file matching in linker script not working.,
memeruiz at gmail dot com <=