]> git.wh0rd.org Git - elf2flt.git/commitdiff
H8/300 relocation fix
authorYoshinori Sato <ysato@users.souceforge.jp>
Wed, 30 Dec 2015 23:55:46 +0000 (00:55 +0100)
committerGreg Ungerer <gerg@uclinux.org>
Thu, 7 Jan 2016 11:49:40 +0000 (21:49 +1000)
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 <ysato@users.sourceforge.jp>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
elf2flt.c

index 60f5207c75d657154f5a3d96a4b11e9567542e8c..17affd937c58597f7ed63e305deb3638a4fee5f8 100644 (file)
--- 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;