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]

bug in .eh_frame_hdr processing


Java is broken on some platforms.  What happens is that exception
handlers in the runtime library fail to execute because the
personality routine in the CIE points to zero, rather than
DW.ref.__gcj_personality_v0.

This seems to be a consequence of the optimization in elf-eh-frame.c.
When generating relocateable output, we really shouldn't adjust the
offset to the personality routine, as it hasn't been relocated yet.

Alternatively, perhaps we shouldn't do this optimization at all when
generating relocateable output, but instead postpone it until final
link.

Andrew.

2003-02-22  Andrew Haley  <aph at redhat dot com>
	
	* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't adjust
	personality offset if we're generating relocateable output.
 
Index: elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.22
diff -u -6 -w -r1.22 elf-eh-frame.c
--- elf-eh-frame.c	6 Feb 2003 23:01:04 -0000	1.22
+++ elf-eh-frame.c	22 Feb 2003 20:05:52 -0000
@@ -940,20 +940,23 @@
 		    if ((per_encoding & 0xf0) == DW_EH_PE_aligned)
 		      buf = (contents
 			     + ((buf - contents + per_width - 1)
 				& ~((bfd_size_type) per_width - 1)));
 		    if (action & 4)
 		      {
+			if (!info->relocateable)
+			  {
 			bfd_vma value;
 
 			value = read_value (abfd, buf, per_width,
 					    get_DW_EH_PE_signed
 					    (per_encoding));
 			value += (sec_info->entry[i].offset
 				  - sec_info->entry[i].new_offset);
 			write_value (abfd, buf, value, per_width);
+			  }
 			action &= ~4;
 		      }
 		    buf += per_width;
 		    break;
 		  case 'R':
 		    if (action & 1)


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