[PATCH ARC 1/8] BFD: new ARC port

Claudiu Zissulescu claziss@gmail.com
Tue Sep 22 20:28:00 GMT 2015


Hi Nick,

> The version of gcc that I use is:
> 
>    gcc 5.1.1 20150618 (Red Hat 5.1.1-4)
> 
> Does this help ?
> 

I am doing something wrong. I have installed fedora22, and I've built the tool chain as indicated, but I cannot get the warning/error popping up. 

Anyhow, I've got a pretty good idea where the error may be located. As I cannot reproduce it, I would like to ask for your help to test this new patch (attached). The patch needs to be applied on top of the previous sent bfd patch.

Thank you,
Claudiu

-------------- next part --------------
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 5d85273..c1848f6 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1325,13 +1325,14 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info,
 #define ADD_RELA(BFD, SECTION, OFFSET, SYM_IDX, TYPE, ADDEND) \
 {\
   struct dynamic_sections ds = arc_create_dynamic_sections (output_bfd, info); \
-  bfd_vma loc = (bfd_vma) ds.srel##SECTION->contents + ((ds.srel##SECTION->reloc_count++) * sizeof (Elf32_External_Rela)); \
+  bfd_byte * rloc = ds.srel##SECTION->contents + \
+    ((ds.srel##SECTION->reloc_count++) * sizeof (Elf32_External_Rela)); \
   Elf_Internal_Rela rel; \
   bfd_put_32 (output_bfd, (bfd_vma) 0, ds.s##SECTION->contents + OFFSET); \
   rel.r_addend = ADDEND; \
   rel.r_offset = (ds.s##SECTION)->output_section->vma + (ds.s##SECTION)->output_offset + OFFSET; \
   rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE); \
-  bfd_elf32_swap_reloca_out (BFD, &rel, (bfd_byte *) loc); \
+  bfd_elf32_swap_reloca_out (BFD, &rel, rloc); \
 }
 
 /* Function :  elf_arc_finish_dynamic_symbol


More information about the Binutils mailing list