This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem linking with static libraries for arm-elf


Hello, All,

I have a project that targets the phillips lpc2100 ARM7 MCU. I have written the startup code and various drivers for the embeded and some custem hardware. My toolchain consists of GMUARM 4.0.2 and newlib-1.14.0. Everything compiles and works just fine on the hardware.
My problems started when I decided to archive all the object files in static libraries and link from them. The linker simply refuses to link to mu libraries. I have several modules like libsys.a, libuart0.a, libi2c.a, libspi.a etc.
Here is the command from my Makefile that assembles the lbs
AR = arm-elf-ar
$(AR) crsv libsys.a $(OBJECTS)
arm-elf-ranlib libsys.a


Here is what happens when I try to link to libsys.a:

arm-elf-gcc ./src/main.o -nostartfiles -nodefaultlibs -nostdlib -static -LC:\cygwin\home\Administrator\soft\arm-elf\lib -LC:\cygwin\home\Administrator\soft\arm-elf\lib -LC:\Program Files\ARMor\eclipse\gcc\lib\gcc\arm-elf\4.0.2 -Xlinker -Tlpc2100.ld -Xlinker -static -otest.elf
lpc210x.ld:299: undefined symbol `endless_loop' referenced in expression
collect2: ld returned 1 exit status
make: *** [test.elf] Error 1
make: Target `all' not remade because of errors.


"endless_loo" IS in the librarry. here is what arm-elf-nm says:

crt0.o:
00000054 t .clear_loop
00000060 t .end_clear_loop
00000084 t .end_set_loop
00000074 t .set_loop
00000017 a INIT_ABORT_MODE
00000011 a INIT_FIQ_MODE
00000012 a INIT_IRQ_MODE
00000013 a INIT_SUPERVISOR_MODE
0000001f a INIT_SYSTEM_MODE
0000001b a INIT_UNDEFINED_MODE
U __bss_beg__
U __bss_end__
U __data_beg__
U __data_beg_src__
U __data_end__
U __stack_end__
U __stack_end_abort__
U __stack_end_fiq__
U __stack_end_irq__
U __stack_end_supervisor__
U __stack_end_undefined__
00000000 t _mainCRTStartup
00000000 t _start
U data_abort_exception
00000090 T endless_loop <<<< HERE IT IS
U fast_interrupt_exception
U main
U prefetch_abort_exception
U reserved_exception
U software_interrupt_exception
00000000 T start
U undefined_instruction_exception


_close_r.o:
00000000 T _close_r
        U device_table

_read_r.o:
00000000 T _read_r
        U device_table
00000000 b standard_input_init.1648

_write_r.o:
00000000 T _write_r
        U device_table
00000000 b standard_error_init.1649
00000004 b standard_output_init.1648

_sbrk_r.o:
00000000 T _sbrk_r
        U end
00000000 b heap_ptr

_lseek_r.o:
00000000 T _lseek_r
        U ioctl

_fstat_r.o:
00000000 T _fstat_r

_ioctl_r.o:
        U _impure_ptr
00000000 T _ioctl_r
        U device_table
000000b8 T ioctl

_open_r.o:
000000a0 T _open_r
00000000 t check_match
        U device_table
        U strchr
        U strlen

isatty.o:
00000000 T isatty

sys_time.o:
00000a78 T GetUs
00000b38 T MinimumAchievableWait
00000000 T StartClock
        U T0EMR
        U T0MCR
        U T0MR3
        U T0PR
        U T0TC
        U T0TCR
00000700 T UsToCounts
        U VPBRate
000008ec T WaitUs
        U __udivdi3
        U __udivsi3
00000804 t accumulate_time
0000000c b count_overhead
000002c0 t counts_to_us
00000380 t divx
00000864 t get_full_counts
00000000 b high_counts
00000010 b last_time.2148
00000004 b max_microsec
00000008 b min_count
00000014 b timing_scale_factor

sys_vpb.o:
        U ActualSpeed
00000078 T VPBControl
        U VPBDIV
00000000 t VPBQuery
00000114 T VPBRate

interrupt_sup.o:
00000000 T DisableInterrupts
00000014 T RestoreInterrupts

sbdvsp.o:
        U CheckFilenameSubMatch
00000264 T InitOpenSubDeviceList
00000888 T SubDeviceClose
0000051c T SubDeviceIoctl
00000638 T SubDeviceOpen
000002e4 T SubDeviceRead
00000400 T SubDeviceWrite
        U _impure_ptr
0000014c t confirm_table_entry
000001ec t discard_table_entry
        U fflush
00000000 t find_table_entry
00000090 t reserve_table_entry
        U strchr
        U strlen

sys_vic.o:
        U DisableInterrupts
        U RestoreInterrupts
        U VICDefVectAddr
00000294 T VICDisable
000002e0 T VICEnable
00000000 T VICInit
        U VICIntEnClr
        U VICIntEnable
        U VICIntSelect
000000e4 T VICSetup
        U VICVectAddr
        U VICVectCntl

chckfnm.o:
00000000 T CheckFilenameSubMatch

sys_pll.o:
00000304 T ActualSpeed
        U PLLCFG
        U PLLCON
        U PLLFEED
        U PLLSTAT
0000007c T SetDesiredSpeed
00000000 T SetNativeSpeed
        U __udivsi3
        U __umodsi3
00000000 d native_speed

sys_mam.o:
        U MAMCR
        U MAMTIM
00000000 T SetMAM


If someone has any idea please share.


Thanks, Apostol Terziev

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]