[PATCH,ppc] fix segfaults when relocating against undefined symbols

Nathan Froyd froydnj@codesourcery.com
Tue Oct 9 20:35:00 GMT 2007


The attached patch fixes a problem with relocation processing on PPC
targets: if we have relocations against undefined symbols, then we will
crash when actually attempting to process the relocations, as there will
be no section to place the required bits in.

Fixed by simply continuing to process relocations in such cases;
warnings and/or errors about undefined symbols will ensure that we give
the user appropriate notice about what is going wrong.

Tested on powerpc-wrs-vxworks, OK to apply?

-Nathan

2007-10-09  Nathan Froyd  <froydnj@codesourcery.com>

	* elf32-ppc.c (ppc_elf_relocate_section): Continue processing
	relocations if the output section is NULL; this guards against
	relocations against global undefined symbols bombing out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc-linker-relocs.patch
Type: text/x-diff
Size: 1934 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071009/48b53250/attachment.bin>


More information about the Binutils mailing list