[PATCH] Fix ld segfault with -Map -Tdata=xxx (arm-none-symbianelf, and maybe other targets)

Nick Clifton nickc@redhat.com
Tue May 17 15:10:00 GMT 2005


Hi Julian,

> This patch fixes a segfault when -Map is used together with -Tdata=xxx 
> with ld on arm-none-symbianelf. The crash doesn't occur when -Tdata 
> isn't used.

> OK to apply, or is something more deeply broken here?

Thanks for supplying this patch.  I am going to apply a variant of the 
patch (see attached) which allows the value for the symbol to be output 
into the map file even if its output section is not known.

Note - whilst looking into this bug I also found a place in elf32-arm.c 
which relied upon the symbol's section being present so I am including a 
fix for that as well.

You are correct however in thinking that there is something else that is 
deeply broken.  Specifying -Tdata (or -Ttext or -Tbss) should not be 
causing this behaviour.  I have looked into it for a while but I could 
find no obvious cause.  This will have to be something to come back to 
at a later date.

Cheers
   Nick

ld/ChangeLog
2005-05-17  Julian Brown <julian@codesourcery.com>

	* ldlang.c (print_assignment): Do not rely upon a valid result
	having a section associated with it.

bfd/ChangeLog2005-05-17  Nick Clifton  <nickc@redhat.com>

	* elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle
	the situation where a symbol's section is not known but a section
	relative R_ARM_RELATIVE reloc has to be generated for the Symbian
	OS.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arm-tdata.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050517/6f06c278/attachment.ksh>


More information about the Binutils mailing list