I think I have found the problem. It is related to the patch Ed sent.
The new LD looks like it automagically turns on the --build-id option. I have not found out how turn it off.
When this option is used it generates the .note.gnu.build-id section. When this section was discarded in the first ld pass (linuxbios_rom.ram creation) it was causing the segmentation fault crash.
It looks like this same option is being called again when crt0.o is linked to create linuxbios. I have added the .note.gnu.build-id section to the .id section in the ldscript.ld file.
SECTIONS { . = (_ROMBASE + ROM_IMAGE_SIZE - 0x10) - (__id_end - __id_start); .id (.) : { *(.id) *(.note.gnu.build-id) }
This has gotten me past the second crash but now linuxbios.strip is crashing.
nm -n linuxbios | sort > linuxbios.map objcopy --gap-fill 0xff -O binary linuxbios linuxbios.strip objcopy: linuxbios.strip: Bad value objcopy: linuxbios.strip: Bad value make[1]: *** [linuxbios.strip] Error 1
So this does not look like a ld problem, but an added feature to ld is causing us grief. If anyone can figure out how to turn this option off, that may fix all of this without any patches... :-)
/********************* Marc Karasek MTS Sun Microsystems mailto:marc.karasek@sun.com ph:770.360.6415 *********************/
Carl-Daniel Hailfinger wrote:
On 03.12.2007 19:15, Marc Karasek wrote:
Unfortunately, it is still broken under Fedora 8.
V3 works, it is just V2 that is having these linking problems. This patch makes things better, and it at least gives us a more descriptive error than just a segmentation fault.
This at least gives me a good starting point to debug from .. I think as soon as we get a stable version that should be the patch..
Please file a bug with the binutils guys. If they don't know ld is broken, they can't fix it.
Regards, Carl-Daniel