Dynamic Libraries

Allan Hessenflow allanh-rtems at kallisti.com
Mon Sep 11 16:30:28 UTC 2006

> I'm having a problem linking in the file generated by xsyms. Here is
> what I do. I have a Loader application and then a TestApp which I want
> to load at runtime.
> test: Loader.o TestAoo.o
> 	@echo --------- Linking Loader application - first pass
> $(LDLIBS) -o Loader
> 	@echo --------- Generating SYSTEM symbol table
> 	$(XSYMS) -C Loader Symbols.c
> 	@echo --------- Compiling SYSTEM symbol table
> 	$(CC) $(CFLAGS) -c -fomit-frame-pointer -fasm -O Symbols.c
> 	@echo --------- Linking Loader application - second pass
> 	$(CC) $(CFLAGS) Symbols.o Loader.o $(CEXP_LDFLAGS) $(CEXP_LIBS)
> $(LDFLAGS) $(LDLIBS) -o Loader 
> I successfully generate  system table from the Loader executable in
> Symbols.c, but then when I'm linking Symbols.o I got the following error
> messages:
> Symbols.o(.data+0x4): undefined reference to `__cexp__dummy_alias_0'
> Symbols.o(.data+0x1c): undefined reference to `__cexp__dummy_alias_1'
> Symbols.o(.data+0x34): undefined reference to `__cexp__dummy_alias_2'
> ...
> Symbols.o(.data+0x1fc): undefined reference to `__cexp__dummy_alias_21'
> Symbols.o(.data+0x214): undefined reference to `__cexp__dummy_alias_22'
> collect2: ld returned 1 exit status

When I was setting something like that up I ran into the same problem, but
noticed that xsyms put out lines on stdout for each of the undefined
__cexp__dummy_alias_* that would work as link commands.  So I redirected
those to a temp file and used that as an additional linker script for the
final link.


Allan N. Hessenflow      allanh at kallisti.com

More information about the users mailing list