mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Currently, each generated loader binary is linked into one data.o object file which is then linked against boot.o. The data.o file is also used to generate the data.h header file using nm, which will contain all symbols required by zipl. The linking process is somewhat depended on the directory, as the symbol names are derived from the file names of the input files, which is the default behavior of the linker. The file name in this case being the entire path. Examples for the current situation (starting from root dir in each case): $ cd zipl/boot && make eckd0_cdl.bin $ cc -no-pie -static -nostdlib -Wl,--relocatable -Wl,--format,binary -o data.o eckd0_cdl.bin $ nm data.o 0000000000000018 D _binary_eckd0_cdl_bin_end 0000000000000018 A _binary_eckd0_cdl_bin_size 0000000000000000 D _binary_eckd0_cdl_bin_start $ make -C zipl/boot eckd0_cdl.bin $ cc -no-pie -static -nostdlib -Wl,--relocatable -Wl,--format,binary -o data.o zipl/boot/eckd0_cdl.bin $ nm data.o 000000000000018 D _binary_zipl_boot_eckd0_cdl_bin_end 000000000000018 A _binary_zipl_boot_eckd0_cdl_bin_size 000000000000000 D _binary_zipl_boot_eckd0_cdl_bin_start The example above shows that the entire path would end up in the symbol name if specified that way. To make this more robust, future proof, and get more control of the resulting symbol names, use '.incbin' and some macros for embedding the loader binary files. This also reduces the linker step and the generation of the data.h header file. Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Co-developed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>