<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span>> i386-rtems4.11-gcc -B../../../../../pc486/lib/ -specs bsp_specs -qrtems -mtune=i486 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaratio<wbr>n </span>-Wstrict-prototypes -Wnested-externs -Wl,-Ttext,0x00100000 -mtune=i486 -o dl01.pre.exe init.o dl-load.o dl-o1.o filesystem.o<br>
<span>> mv dl01.pre.exe dl01.pre<br>
> rtems-syms -e -c "-mtune=i486 -O2 -g -Wall -Wmissing-prototypes </span>-Wimplicit-function-declaratio<wbr>n -Wstrict-prototypes -Wnested-externs" -o dl-sym.o dl01.pre<br>
<span>> i386-rtems4.11-gcc -B../../../../../pc486/lib/ -specs bsp_specs -qrtems -mtune=i486 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaratio<wbr>n </span>-Wstrict-prototypes -Wnested-externs -Wl,-Ttext,0x00100000 -mtune=i486 -o dl01.exe init.o dl-load.o dl-o1.o dl-sym.o filesystem.o<span><br>
<br>
</span>You have linked the object you wish to run time load into the base kernel<br>
executable.<br>
<span class="m_1262225549609532217gmail-m_4736022984184596765HOEnZb"><font color="#888888">
Chris<br></font></span></blockquote><div><br></div><div>Thanks Chris. So far I can't solve this problem.<br></div><div>I'm sorry for the stupid newbie questions but I just don't get the mechanism. <br><br>I have a printf symbol in the base image dl.exe.<br></div><div>I load the object file dl.o that uses printf. dl.o.<br>dl.c contains rtems_main and printf functions. dl.o is obtained using the following command:<br><br><span style="font-family:monospace,monospace">i386-rtems4.11-gcc -B$(RTEMS_MAKEFILE_PATH)lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I. -I.. -I./include -mtune=i486 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-<wbr>declaration -Wstrict-prototypes -Wnested-externs -MT dl.o -MD -MP -MF .deps/dl.Tpo -c -o dl.o dl.c<br></span><br></div><div>Symbol table dl-sym.o is obtained using the following commands:<br> <br></div><div><font size="2"><span style="font-family:monospace,monospace">i386-rtems4.11-gcc -B$(RTEMS_MAKEFILE_PATH)lib/ -specs bsp_specs -qrtems -mtune=i486 -O2 -g \<br>-Wall -Wmissing-prototypes -Wimplicit-function-<wbr>declaration -Wstrict-prototypes -Wnested-externs \<br>-Wl,-Ttext,0x00100000 -mtune=i486 -o dl.pre init.o filesystem.o dl.o<br><br>rtems-syms -e -c "-mtune=i486 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-<wbr>declaration -Wstrict-prototypes -Wnested-externs" -o dl-sym.o dl.pre</span></font><br></div><div><br></div><div>It's content is:<br><span style="font-family:monospace,monospace">Symbol table '.symtab' contains 1999 entries:<br> Num: Value Size Type Bind Vis Ndx Name<br> 0: 00000000 0 NOTYPE LOCAL DEFAULT UND <br> 1: 00000000 0 FILE LOCAL DEFAULT ABS rld--YAfaaa.c<br> 2: 00000000 0 SECTION LOCAL DEFAULT 1 <br> 3: 00000000 0 SECTION LOCAL DEFAULT 3 <br> 4: 00000000 0 SECTION LOCAL DEFAULT 4 <br> 5: 00000000 0 SECTION LOCAL DEFAULT 5 <br> 6: 00000000 0 NOTYPE LOCAL DEFAULT 5 rtems__rtl_base_globals<br> 7: 0000c1cc 0 NOTYPE LOCAL DEFAULT 5 rtems__rtl_base_globals_s<br> 8: 00000000 0 SECTION LOCAL DEFAULT 7 <br> 9: 00000000 0 SECTION LOCAL DEFAULT 9 <br> 10: 00000000 0 SECTION LOCAL DEFAULT 8 <br> 11: 00000000 0 NOTYPE GLOBAL DEFAULT UND BSPPrintkPort<br> 12: 00000000 0 NOTYPE GLOBAL DEFAULT UND BSP_get_current_rtems_irq<br> 13: 00000000 0 NOTYPE GLOBAL DEFAULT UND BSP_inch<br>..............................<wbr>..............................<wbr>.......<br> 1051: 00000000 0 NOTYPE GLOBAL DEFAULT UND preserve_fd_acls<br> 1052: 00000000 0 NOTYPE GLOBAL DEFAULT UND printCpuInfo<br> 1053: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf<br> 1054: 00000000 0 NOTYPE GLOBAL DEFAULT UND printk<br> 1055: 00000000 0 NOTYPE GLOBAL DEFAULT UND printk_plugin<br></span><span style="font-family:monospace,monospace">..............................<wbr>..............................<wbr>.......<br></span><span style="font-family:monospace,monospace"> 1356: 00000000 0 NOTYPE GLOBAL DEFAULT UND rtems_main</span><br></div><div><br><span style="font-family:arial,helvetica,sans-serif">Is it correct that all symbols are undefined?</span><br><br>When I load dl.o with dl_open the rtl is looking for the symbols from .rel.text section in local and global symbol tables of dl.o.<br><br><span style="font-family:monospace,monospace">Relocation section '.rel.text' at offset 0x618 contains 2 entries:<br> Offset Info Type Sym.Value Sym. Name<br>00000027 00000501 R_386_32 00000000 .rodata.str1.1<br>0000002c 00001002 R_386_PC32 00000000 printf<br><br></span></div><div><span style="font-family:monospace,monospace">rtl can't find printf.<br></span></div><div><span style="font-family:monospace,monospace">I don't link any files against dl-sym.o. Is it possible to use printf of base image or I need to link dl.o against libc?</span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace">Best regards,</span></div><div><span style="font-family:monospace,monospace">Pavel.</span></div></div></div></div>