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]

Fix for H8 relaxing segfault



Sigh.  I've had this lying around in my personal directory for a long time,
but couldn't remember why I wrote the patch.  A net bug reminded me :-)

	* elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
	relocations.

Index: elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 elf32-h8300.c
*** elf32-h8300.c	6 Jun 2002 00:29:20 -0000	1.12
--- elf32-h8300.c	6 Jun 2002 21:31:43 -0000
*************** elf32_h8_merge_private_bfd_data (ibfd, o
*** 678,687 ****
       mov.b:16	     ->    mov.b:8                2 bytes
       mov.b:24/32     ->    mov.b:8                4 bytes
  
!      mov.[bwl]:24/32 ->    mov.[bwl]:16           2 bytes
! 
! 
! */
  
  static boolean
  elf32_h8_relax_section (abfd, sec, link_info, again)
--- 678,684 ----
       mov.b:16	     ->    mov.b:8                2 bytes
       mov.b:24/32     ->    mov.b:8                4 bytes
  
!      mov.[bwl]:24/32 ->    mov.[bwl]:16           2 bytes */
  
  static boolean
  elf32_h8_relax_section (abfd, sec, link_info, again)
*************** elf32_h8_relax_section (abfd, sec, link_
*** 747,752 ****
--- 744,756 ----
  	 some long jumps created by the compiler.  */
        if (irel != internal_relocs)
  	last_reloc = irel - 1;
+ 
+       if (ELF32_R_TYPE (irel->r_info) != R_H8_DIR24R8
+ 	  && ELF32_R_TYPE (irel->r_info) != R_H8_PCREL16
+ 	  && ELF32_R_TYPE (irel->r_info) != R_H8_DIR16A8
+ 	  && ELF32_R_TYPE (irel->r_info) != R_H8_DIR24A8
+ 	  && ELF32_R_TYPE (irel->r_info) != R_H8_DIR32A16)
+ 	continue;
  
        /* Get the section contents if we haven't done so already.  */
        if (contents == NULL)
	* elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
	relocations.



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