This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix ld segfault with -Map -Tdata=xxx (arm-none-symbianelf,and maybe other targets)
- From: Julian Brown <julian at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Cc: Julian Brown <julian at codesourcery dot com>
- Date: Thu, 05 May 2005 19:59:31 +0100
- Subject: [PATCH] Fix ld segfault with -Map -Tdata=xxx (arm-none-symbianelf,and maybe other targets)
Hi,
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.
The problem occurs when writing the map file; the call to
ldexp.c:exp_fold_tree in ldlang.c:print_assignment returns
result.section==0 and result.valid_p==true in the breaking case. The
patch just stops the crashing code from being executed.
Tested with targets=all on i686-pc-linux-gnu.
OK to apply, or is something more deeply broken here?
Julian
? bfd/doc/bfd.info
? gas/doc/as.info
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.173.2.1
diff -c -p -r1.173.2.1 ldlang.c
*** ld/ldlang.c 17 Mar 2005 16:37:33 -0000 1.173.2.1
--- ld/ldlang.c 5 May 2005 00:49:21 -0000
*************** print_assignment (lang_assignment_statem
*** 2744,2750 ****
result = exp_fold_tree (tree, output_section, lang_final_phase_enum,
print_dot, &print_dot);
! if (result.valid_p)
{
bfd_vma value;
--- 2744,2750 ----
result = exp_fold_tree (tree, output_section, lang_final_phase_enum,
print_dot, &print_dot);
! if (result.valid_p && result.section)
{
bfd_vma value;