How to create the final .RST file so that it includes the relocated ASM code of routines defined in libraries? My .RST files only contain the relocated code of the file I am compiling. Here goes an example of what I am doing:
% sdcc -mhc08 --xram-loc 0x70 --code-loc 0x70 --stack-loc 0x086 -L `pwd` -l lib_func lib_test.c
I guess there might be a linker switch to do that, but I am banging my head against the wall to find it. By the way, linking is performed by the link-hc08:
ASxxxx Linker V01.70 + NoICE + SDCC Feb 1999
This is not possible from the library. Your only option is to recompile the used modules from the library and link them by hand with your project just like any other source file in your project.
That's is bad... What do you mean by "recompile the used modules from the library"? Should I get the .rel files back from the library and do the link passing them explicitely in the command line?
No. The .rel files are compiled already. You should get the .c files from the library sources and compile them. Then you can link the newly generated .rel files with your project by passing them on the command line.
I guess you are suggesting this:
% sdcc -mhc08 -c c_lib_func_x2.c
% sdcc -mhc08 -c c_lib_func_x3.c
% sdcc -mhc08 --xram-loc 0x70 --code-loc 0x800 --stack-loc 0x100 lib_test.c c_lib_func_x2.rel c_lib_func_x3.rel
The list_test .RST and .LST files do not include the ASM source code of the c_lib_func_x* functions:
% grep c_lib_func_x lib_test.rst
084E CD 08 A6 138 jsr _c_lib_func_x2
0870 CD 08 B1 158 jsr _c_lib_func_x3
Am I missing something?
Of course lib_test.lst/rst do not contain the asm of c_lib_func_x2. The asm is in the c_lib_func_x2.lst and c_lib_func_x2.rst which were just created by compilng and linking.
If the asm of all modules would appear in the listing of one module then what is the purpose of the linker? That would be like #include-ing all library sources in your one-and-only sourcefile.
I'd like to have a .RST file with the ASM code of the library functions in order to make the debug easier in ASM level. All the symbols that are relative in the individual .REL file would be resolved by the linker and would be absolute in the final .REL, dismissing the "translation" by the user.
And the reason why #include-ing the source code of all library functions is not desired is that the final object code (.S19 in my case) would be bigger than necessary, having also the functions not called in main file. Certainly the user could hand-pick only the necessary sources, but it is not smart replicating what the liker does for us for free. That's why I really need the .RST with the library ASM code included and with its relative references resolved.