From: Yoshinori Sato Date: Wed, 30 Dec 2015 23:55:46 +0000 (+0100) Subject: H8/300 relocation fix X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=12e1c4a0eedeef64250196f07846bd9043220c46;p=elf2flt.git H8/300 relocation fix Add new relocation R_H8_DISP32A16. hi-byte clear on R_H8_DIR32 R_H8_DIR24A8 R_H8_DIR24R8 R_H8_DIR32A16 R_H8_DISP32A16 Signed-off-by: Yoshinori Sato Signed-off-by: Waldemar Brodkorb Signed-off-by: Greg Ungerer --- diff --git a/elf2flt.c b/elf2flt.c index 60f5207..17affd9 100644 --- a/elf2flt.c +++ b/elf2flt.c @@ -723,6 +723,17 @@ dump_symbols(symbols, number_of_symbols); flat_reloc_count++; break; +#elif defined (TARGET_h8300) + case R_H8_DIR32: + case R_H8_DIR24A8: + case R_H8_DIR24R8: + case R_H8_DIR32A16: + case R_H8_DISP32A16: + r_mem[0] = 0; + goto good_32bit_resolved_reloc; + case R_H8_PCREL8: + case R_H8_PCREL16: + continue; #else default: /* The default is to assume that the @@ -878,6 +889,7 @@ dump_symbols(symbols, number_of_symbols); break; case R_H8_DIR32: case R_H8_DIR32A16: /* currently 32, could be made 16 */ + case R_H8_DISP32A16: if (sym_reloc_size != 4) { printf("R_H8_DIR32 size %d\n", sym_reloc_size); bad_relocs++; @@ -889,6 +901,7 @@ dump_symbols(symbols, number_of_symbols); sym_addr += sym_vma + q->addend; break; case R_H8_PCREL16: + relocation_needed = 0; sym_vma = 0; sym_addr = (*(q->sym_ptr_ptr))->value; sym_addr += sym_vma + q->addend; @@ -898,6 +911,7 @@ dump_symbols(symbols, number_of_symbols); bfd_big_endian(abs_bfd) ? htons(sym_addr) : sym_addr; continue; case R_H8_PCREL8: + relocation_needed = 0; sym_vma = 0; sym_addr = (*(q->sym_ptr_ptr))->value; sym_addr += sym_vma + q->addend;