This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]