This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

Re: Re: new elf loader library


Adam Agnew wrote:
> 
> Hmm, I'm having a lot of trouble with what looks to be the generated ld
> file. Could someone give a few words on the status of all this and what
> I could possibly do to make our attempt at bringing the elf loader into
> redboot a little easier?

I'll have a look...

> /redboot/build/install/lib/libtarget.a(services_loader_loader.o): In
> function `global destructors keyed to
> Cyg_Loader::Cyg_Loader(Cyg_LoaderMemAlloc *)':
> /redboot/ecos/packages/services/loader/current/src/loader.cxx:115:
> undefined reference to `_DYNAMIC'

Perhaps it means line 269. Since we aren't doing dynamic linking that (and
all other dynamic linking bits) should be subject to a config option, off
for redboot.

> /redboot/ecos/packages/services/loader/current/src/loader.cxx:115:
> undefined reference to `Cyg_Loader::loader'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_pure.o): In function
> `__pure_virtual':
> /usr/src/bs/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x22):
> undefined reference to `__write'

This one is because you are using native linux tools that assume the C
library is glibc. For your purposes, provide a small function which
converts write(fd, buf, n) to diag_printf("%s",buf); because that's all it
is used for in libgcc. You can provide an alias for __write using
CYGBLD_ATTRIB_ALIAS from <cyg/infra/cyg_type.h>

> /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_eh.o): In function
> `__default_terminate':
> /usr/src/bs/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x17):
> undefined reference to `abort'

Providing a version of abort() in redboot is no issue. Just add one in
redboot's misc_funs.c which does a diag_printf("abort!\n") and then calls
breakpoint(); I think.

/usr/src/bs/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x79b):
> undefined reference to `stderr'
> /usr/src/bs/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x7a3):
> undefined reference to `fprintf'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_eh.o): In function
> `get_reg_addr':

Add another simple function which is just:

fprintf(void *ignore, const char *fmt, ... )
{
  diag_vprintf(.....
}

Jifl 
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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