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]
Other format: [Raw text]

symbol not present in a.out


I have target.ld and libtarget.a ready (for a configuration) and want to
link it. But I have a problem described below:
There are two source files (libtarget.a contains their object files) init.c
and main.c

main.c contains
void my_init(void)
{
}

init.c contains
externC void my_init(void);
class my_init_class {
    public:
        my_init_class(void)

            my_init();
        }
};
/* And here's an instance of the class just to make the code run*/
static my_init_class my_init CYGBLD_ATTRIB_INIT_AFTER(CYG_INIT_LIBC);

When I extract all the object files from libtarget.a and execute i386-elf-nm
init.o (exact name is prefix with some template configuration) and
i386-elf-nm main.o, I see following output
init.o :
    U my_init

main.o
    00000000 T my_init

When I link libtarget.a to my hello world application and get an a.out, I
don't see this symbol in a.out. i386-elf-nm a.out | grep my_init does not
return anything. Any clues?

Regards
Mohanlal

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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