Linker Symbol placment and debug stubs issue - initrd
Posted: Wed Apr 22, 2020 12:39 am
I am having an issue getting a linker symbol to be placed at the end of my kernel when debug information is added.
I have my own linker script with a symbol placed at its end to mark the end of the kernel and the idea is to cat on a tar file for use as a initrd.
Problem is any time i do a debug build the debug information is placed after the end of kernel symbol and that then screws up the offset to the initrd.
I have tried specifying the sections for debug information in the linker script it self but that seems to mess up an offset gdb uses and it does not load debugging symbols properly.
So i find myself at a bit of a loss as to how i can work around this issue.
i have used a hex editor to conform the position of the initrd so i know the symbol when i get its address at run time is incorrect and can see the debug information after the offset of the end of kernel symbol.
Does anyone know of a way to tell ld where to put debug information without messing up the offset for gdb.
Or maybe have some advice as what direction to look next for a possible solution.
Regards Xain Faith
I have my own linker script with a symbol placed at its end to mark the end of the kernel and the idea is to cat on a tar file for use as a initrd.
Problem is any time i do a debug build the debug information is placed after the end of kernel symbol and that then screws up the offset to the initrd.
I have tried specifying the sections for debug information in the linker script it self but that seems to mess up an offset gdb uses and it does not load debugging symbols properly.
So i find myself at a bit of a loss as to how i can work around this issue.
i have used a hex editor to conform the position of the initrd so i know the symbol when i get its address at run time is incorrect and can see the debug information after the offset of the end of kernel symbol.
Does anyone know of a way to tell ld where to put debug information without messing up the offset for gdb.
Or maybe have some advice as what direction to look next for a possible solution.
Regards Xain Faith