This is the mail archive of the binutils@sourceware.org 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]

Re: ARC port broken reloc processing


* Alan Modra <amodra@gmail.com> [2015-11-27 14:09:38 +1030]:

> On Fri, Nov 27, 2015 at 01:14:12PM +1030, Alan Modra wrote:
> > Why allow zero for the base address, and the variant ranges?
> 
> I had a look.  If it was for arc-elf, please don't weaken the test.
> arc-elf reloc processing via howto is broken.
> 
> This..
> 
> #define ARC_RELOC_HOWTO(TYPE, VALUE, RSIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
>   [TYPE] = HOWTO (R_##TYPE, 0, RSIZE, BITSIZE, FALSE, 0, complain_overflow_##OVERFLOW, arc_elf_reloc, #TYPE, FALSE, 0, 0, FALSE),
> 
> static struct reloc_howto_struct elf_arc_howto_table[] =
> {
> #include "elf/arc-reloc.def"
> }
> 
> ..results in all reloc howtos having 0 for dst_mask, ie. don't
> actually apply the relocation.  Clearly this needs to be fixed by
> modifying arc-reloc.def to add the appropriate bits to be used in
> dst_mask.

Thanks for this pointer.  I've attached a patch below that fills in
the dst_mask field for some of the relocations, and the hack in my
original test is no longer required.

What do you think of this patch?  The commit message is a little long,
but I hope it makes sense, I wanted to capture the thinking behind
this patch, as filling in the dst_mask is not the only possible
solution.

If we look at the xtensa target then we see that they make use of the
special function hook to patch all the relocations, and this would
actually seem like a better way to go for arc, given that some of the
relocations are too complex to be patched using the generic mechanism.

However, when using the generic mechanism, I don't think that it's
really possible to patch all of the relocations, for example, the
GOT/PLT relocations would I think be hard to patch from the special
function.

For inspiration, I looked at the arm target, but for that target the
special function hook is not used (like it is for xtensa) and instead
arm relies on the generic patching mechanism.  However, I don't think
that the GOT/PLT relocation patched using the generic mechanism will
actually be correct, but I suspect this is not actually important, I
figure the only relocations that really matter are those that end up
being applied to the dwarf.

So, in the end, having considered the special function approach, I
took your advice :) and just filled in the dst_mask for those
relocations that have a very simple dst_mask value.  For any
relocations that would require a more complex dst_mask, I just leave
the value as 0.

----

    arc: Fill in the dst_mask field for the howto structures.
    
    Currently the dst_mask field is filled in with 0 for all arc
    relocations.
    
    This makes sense, a large number of arc relocations are non-standard,
    either computing the relocation value, or how the value is patched in,
    is more complex than can be expressed within the howto structure.  This
    is fine though, for ELF only links (which is all the arc-elf target
    supports) the final relocation resolution is all done within the
    arc_do_relocation function, which is called from
    elf_arc_relocate_section, and this makes no use of the dst_mask field.
    
    However, currently, the generic relocation mechanism, the one accessed
    through bfd_perform_relocation has a problem.  The generic mechanism
    is used in a few corner cases, when the ELF specialisation can't be
    used, for example, when using objdump to dump the dwarf from an object
    file, in this case the relocations within the dwarf are patched using
    the generic relocation mechanism.
    
    The generic relocation mechanism can (currently) not be taught to patch
    all arc relocations, some are just too complex.  The way other targets
    deal with this problem, for example xtensa, is to make use of the
    special function within the howto structure to completely handle the
    patching of the relocations.
    
    The problem with this use of the special function is that some of the
    relocations, for example those relating to GOT and PLT are hard to patch
    correctly (if at all?) when not performing ELF final (or partial) links.
    
    The conclusion that I reached is that overloading the special function
    would not be worth the effort, we would not gain the ability to
    correctly patch all relocations (the GOT/PLT relocations would not be
    handled), so I instead added the dst_mask field to the howto table.
    
    However, given that the value computed for some relocations (GOT/PLT for
    example) will not be correct, filling in the dst_mask for these
    relocations seems pretty pointless, better to leave the dst_mask as 0,
    so it's clear that the relocation has not been patched.
    
    And so, in this patch I have extended the relocation definitions in
    arc-reloc.def, to include a dst_mask field.  For most relocations this
    is 0, however, for those relocations that are likely to be used within
    the dwarf I've filled in the dst_mask field with an appropriate value.
    
    Before this commit, viewing the dwarf within an object file (using,
    for example, objdump) would display 0 in all (or most) address fields.
    After this commit the address fields are patched to more appropriate
    values.
    
    bfd/ChangeLog:
    
    	* elf32-arc.c: Add dst_mask parameter to each instance of
    	ARC_RELOC_HOWTO.  When creating the elf_arc_howto_table make use
    	of the dst_mask parameter.
    
    include/elf/ChangeLog:
    
    	* arc-reloc.def: Add dst_mask attribute to all relocations.
    	* arc.h: Add dst_mask parameter to ARC_RELOC_HOWTO definition.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b87f914..8ccdb00 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-28  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* elf32-arc.c: Add dst_mask parameter to each instance of
+	ARC_RELOC_HOWTO.  When creating the elf_arc_howto_table make use
+	of the dst_mask parameter.
+
 2015-11-20  Stefan Teleman  <stefan.teleman@oracle.com>
 
 	PR ld/19260
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 37a426c..1dc1bbc 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -90,7 +90,7 @@ char * init_str = INIT_SYM_STRING;
 char * fini_str = FINI_SYM_STRING;
 
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
       case VALUE: \
 	return #TYPE; \
 	break;
@@ -193,7 +193,7 @@ arc_elf_reloc (bfd *abfd ATTRIBUTE_UNUSED,
 }
 
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   TYPE = VALUE,
 enum howto_list
 {
@@ -202,8 +202,8 @@ enum howto_list
 };
 #undef ARC_RELOC_HOWTO
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, RSIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
-  [TYPE] = HOWTO (R_##TYPE, 0, RSIZE, BITSIZE, FALSE, 0, complain_overflow_##OVERFLOW, arc_elf_reloc, #TYPE, FALSE, 0, 0, FALSE),
+#define ARC_RELOC_HOWTO(TYPE, VALUE, RSIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+  [TYPE] = HOWTO (R_##TYPE, 0, RSIZE, BITSIZE, FALSE, 0, complain_overflow_##OVERFLOW, arc_elf_reloc, #TYPE, FALSE, 0, DST_MASK, FALSE),
 
 static struct reloc_howto_struct elf_arc_howto_table[] =
 {
@@ -228,7 +228,7 @@ static struct reloc_howto_struct elf_arc_howto_table[] =
 
 static void arc_elf_howto_init (void)
 {
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   elf_arc_howto_table[TYPE].pc_relative = \
     (strstr (#FORMULA, " P ") != NULL || strstr (#FORMULA, " PDATA ") != NULL);
 
@@ -237,7 +237,7 @@ static void arc_elf_howto_init (void)
 #undef ARC_RELOC_HOWTO
 
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   [TYPE] = VALUE,
 const int howto_table_lookup[] =
 {
@@ -256,7 +256,7 @@ struct arc_reloc_map
   unsigned char   elf_reloc_val;
 };
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   { BFD_RELOC_##TYPE, R_##TYPE },
 static const struct arc_reloc_map arc_reloc_map[] =
 {
@@ -514,7 +514,7 @@ get_middle_endian_relocation (bfd_vma reloc)
 
 #define none (0)
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   case R_##TYPE: \
     { \
       bfd_vma bitsize ATTRIBUTE_UNUSED = BITSIZE; \
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 22a25cb..ee4307e 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-28  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* arc-reloc.def: Add dst_mask attribute to all relocations.
+	* arc.h: Add dst_mask parameter to ARC_RELOC_HOWTO definition.
+
 2015-11-11  Alan Modra  <amodra@gmail.com>
 	    Peter Bergner <bergner@vnet.ibm.com>
 
diff --git a/include/elf/arc-reloc.def b/include/elf/arc-reloc.def
index 893291f..0b86bc1 100644
--- a/include/elf/arc-reloc.def
+++ b/include/elf/arc-reloc.def
@@ -1,6 +1,7 @@
 ARC_RELOC_HOWTO(ARC_NONE, 0, \
                 2, \
                 32, \
+                0, \
                 replace_none, \
                 bitfield, \
                 0)
@@ -8,6 +9,7 @@ ARC_RELOC_HOWTO(ARC_NONE, 0, \
 ARC_RELOC_HOWTO(ARC_8, 1, \
                 0, \
                 8, \
+                0xff, \
                 replace_bits8, \
                 bitfield, \
                 ( S + A ))
@@ -15,6 +17,7 @@ ARC_RELOC_HOWTO(ARC_8, 1, \
 ARC_RELOC_HOWTO(ARC_16, 2, \
                 1, \
                 16, \
+                0xffff, \
                 replace_bits16, \
                 bitfield, \
                 ( S + A ))
@@ -22,6 +25,7 @@ ARC_RELOC_HOWTO(ARC_16, 2, \
 ARC_RELOC_HOWTO(ARC_24, 3, \
                 2, \
                 24, \
+                0xffffff, \
                 replace_bits24, \
                 bitfield, \
                 ( S + A ))
@@ -29,6 +33,7 @@ ARC_RELOC_HOWTO(ARC_24, 3, \
 ARC_RELOC_HOWTO(ARC_32, 4, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( S + A ))
@@ -36,6 +41,7 @@ ARC_RELOC_HOWTO(ARC_32, 4, \
 ARC_RELOC_HOWTO(ARC_N8, 8, \
                 0, \
                 8, \
+                0xff, \
                 replace_bits8, \
                 bitfield, \
                 ( S - A ))
@@ -43,6 +49,7 @@ ARC_RELOC_HOWTO(ARC_N8, 8, \
 ARC_RELOC_HOWTO(ARC_N16, 9, \
                 1, \
                 16, \
+                0xffff, \
                 replace_bits16, \
                 bitfield, \
                 ( S - A ))
@@ -50,6 +57,7 @@ ARC_RELOC_HOWTO(ARC_N16, 9, \
 ARC_RELOC_HOWTO(ARC_N24, 10, \
                 2, \
                 24, \
+                0xffffff, \
                 replace_bits24, \
                 bitfield, \
                 ( S - A ))
@@ -57,6 +65,7 @@ ARC_RELOC_HOWTO(ARC_N24, 10, \
 ARC_RELOC_HOWTO(ARC_N32, 11, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( S - A ))
@@ -64,6 +73,7 @@ ARC_RELOC_HOWTO(ARC_N32, 11, \
 ARC_RELOC_HOWTO(ARC_SDA, 12, \
                 2, \
                 9, \
+                0, \
                 replace_disp9, \
                 bitfield, \
                 ( S + A ))
@@ -71,6 +81,7 @@ ARC_RELOC_HOWTO(ARC_SDA, 12, \
 ARC_RELOC_HOWTO(ARC_SECTOFF, 13, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( S - SECTSTART ) + A ))
@@ -78,6 +89,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF, 13, \
 ARC_RELOC_HOWTO(ARC_S21H_PCREL, 14, \
                 2, \
                 20, \
+                0, \
                 replace_disp21h, \
                 signed, \
                 ( ( ( S + A ) - P ) >> 1 ))
@@ -85,6 +97,7 @@ ARC_RELOC_HOWTO(ARC_S21H_PCREL, 14, \
 ARC_RELOC_HOWTO(ARC_S21W_PCREL, 15, \
                 2, \
                 19, \
+                0, \
                 replace_disp21w, \
                 signed, \
                 ( ( ( S + A ) - P ) >> 2 ))
@@ -92,6 +105,7 @@ ARC_RELOC_HOWTO(ARC_S21W_PCREL, 15, \
 ARC_RELOC_HOWTO(ARC_S25H_PCREL, 16, \
                 2, \
                 24, \
+                0, \
                 replace_disp25h, \
                 signed, \
                 ( ( ( S + A ) - P ) >> 1 ))
@@ -99,6 +113,7 @@ ARC_RELOC_HOWTO(ARC_S25H_PCREL, 16, \
 ARC_RELOC_HOWTO(ARC_S25W_PCREL, 17, \
                 2, \
                 23, \
+                0, \
                 replace_disp25w, \
                 signed, \
                 ( ( ( S + A ) - P ) >> 2 ))
@@ -106,6 +121,7 @@ ARC_RELOC_HOWTO(ARC_S25W_PCREL, 17, \
 ARC_RELOC_HOWTO(ARC_SDA32, 18, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( S + A ) - _SDA_BASE_ ))
@@ -113,6 +129,7 @@ ARC_RELOC_HOWTO(ARC_SDA32, 18, \
 ARC_RELOC_HOWTO(ARC_SDA_LDST, 19, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 signed, \
                 ( ( S + A ) - _SDA_BASE_ ))
@@ -120,6 +137,7 @@ ARC_RELOC_HOWTO(ARC_SDA_LDST, 19, \
 ARC_RELOC_HOWTO(ARC_SDA_LDST1, 20, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 signed, \
                 ( ( ( S + A ) - _SDA_BASE_ ) >> 1 ))
@@ -127,6 +145,7 @@ ARC_RELOC_HOWTO(ARC_SDA_LDST1, 20, \
 ARC_RELOC_HOWTO(ARC_SDA_LDST2, 21, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 signed, \
                 ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
@@ -134,6 +153,7 @@ ARC_RELOC_HOWTO(ARC_SDA_LDST2, 21, \
 ARC_RELOC_HOWTO(ARC_SDA16_LD, 22, \
                 1, \
                 9, \
+                0, \
                 replace_disp9s, \
                 signed, \
                 ( ( S + A ) - _SDA_BASE_ ))
@@ -141,6 +161,7 @@ ARC_RELOC_HOWTO(ARC_SDA16_LD, 22, \
 ARC_RELOC_HOWTO(ARC_SDA16_LD1, 23, \
                 1, \
                 9, \
+                0, \
                 replace_disp9s, \
                 signed, \
                 ( ( ( S + A ) - _SDA_BASE_ ) >> 1 ))
@@ -148,6 +169,7 @@ ARC_RELOC_HOWTO(ARC_SDA16_LD1, 23, \
 ARC_RELOC_HOWTO(ARC_SDA16_LD2, 24, \
                 1, \
                 9, \
+                0, \
                 replace_disp9s, \
                 signed, \
                 ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
@@ -155,6 +177,7 @@ ARC_RELOC_HOWTO(ARC_SDA16_LD2, 24, \
 ARC_RELOC_HOWTO(ARC_S13_PCREL, 25, \
                 1, \
                 11, \
+                0, \
                 replace_disp13s, \
                 signed, \
                 ( ( ( S + A ) - P ) >> 2 ))
@@ -162,6 +185,7 @@ ARC_RELOC_HOWTO(ARC_S13_PCREL, 25, \
 ARC_RELOC_HOWTO(ARC_W, 26, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( S + A ) & ( ~3 ) ))
@@ -169,6 +193,7 @@ ARC_RELOC_HOWTO(ARC_W, 26, \
 ARC_RELOC_HOWTO(ARC_32_ME, 27, \
                 2, \
                 32, \
+                0, \
                 replace_limm, \
                 signed, \
                 ( S + A ))
@@ -176,6 +201,7 @@ ARC_RELOC_HOWTO(ARC_32_ME, 27, \
 ARC_RELOC_HOWTO(ARC_32_ME_S, 105, \
                 2, \
                 32, \
+                0, \
                 replace_limms, \
                 signed, \
                 ( S + A ))
@@ -183,6 +209,7 @@ ARC_RELOC_HOWTO(ARC_32_ME_S, 105, \
 ARC_RELOC_HOWTO(ARC_N32_ME, 28, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( S - A ))
@@ -190,6 +217,7 @@ ARC_RELOC_HOWTO(ARC_N32_ME, 28, \
 ARC_RELOC_HOWTO(ARC_SECTOFF_ME, 29, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( S - SECTSTART ) + A ))
@@ -197,6 +225,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_ME, 29, \
 ARC_RELOC_HOWTO(ARC_SDA32_ME, 30, \
                 2, \
                 32, \
+                0, \
                 replace_limm, \
                 signed, \
                 ( ( S + A ) - _SDA_BASE_ ))
@@ -204,6 +233,7 @@ ARC_RELOC_HOWTO(ARC_SDA32_ME, 30, \
 ARC_RELOC_HOWTO(ARC_W_ME, 31, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( S + A ))
@@ -211,6 +241,7 @@ ARC_RELOC_HOWTO(ARC_W_ME, 31, \
 ARC_RELOC_HOWTO(AC_SECTOFF_U8, 35, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( S + A ) - SECTSTART ))
@@ -218,6 +249,7 @@ ARC_RELOC_HOWTO(AC_SECTOFF_U8, 35, \
 ARC_RELOC_HOWTO(AC_SECTOFF_U8_1, 36, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( ( S + A ) - SECTSTART ) >> 1 ))
@@ -225,6 +257,7 @@ ARC_RELOC_HOWTO(AC_SECTOFF_U8_1, 36, \
 ARC_RELOC_HOWTO(AC_SECTOFF_U8_2, 37, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( ( S + A ) - SECTSTART ) >> 2 ))
@@ -232,6 +265,7 @@ ARC_RELOC_HOWTO(AC_SECTOFF_U8_2, 37, \
 ARC_RELOC_HOWTO(AC_SECTFOFF_S9, 38, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( S + A ) - SECTSTART ))
@@ -239,6 +273,7 @@ ARC_RELOC_HOWTO(AC_SECTFOFF_S9, 38, \
 ARC_RELOC_HOWTO(AC_SECTFOFF_S9_1, 39, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( ( S + A ) - SECTSTART ) >> 1 ))
@@ -246,6 +281,7 @@ ARC_RELOC_HOWTO(AC_SECTFOFF_S9_1, 39, \
 ARC_RELOC_HOWTO(AC_SECTFOFF_S9_2, 40, \
                 2, \
                 9, \
+                0, \
                 replace_disp9ls, \
                 bitfield, \
                 ( ( ( S + A ) - SECTSTART ) >> 2 ))
@@ -253,6 +289,7 @@ ARC_RELOC_HOWTO(AC_SECTFOFF_S9_2, 40, \
 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1, 41, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( ( S - SECTSTART ) + A ) >> 1 ))
@@ -260,6 +297,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1, 41, \
 ARC_RELOC_HOWTO(ARC_SECTOFF_ME_2, 42, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( ( S - SECTSTART ) + A ) >> 2 ))
@@ -267,6 +305,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_ME_2, 42, \
 ARC_RELOC_HOWTO(ARC_SECTOFF_1, 43, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( ( S - SECTSTART ) + A ) >> 1 ))
@@ -274,6 +313,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_1, 43, \
 ARC_RELOC_HOWTO(ARC_SECTOFF_2, 44, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 bitfield, \
                 ( ( ( S - SECTSTART ) + A ) >> 2 ))
@@ -281,6 +321,7 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_2, 44, \
 ARC_RELOC_HOWTO(ARC_SDA16_ST2, 48, \
                 1, \
                 9, \
+                0, \
                 replace_disp9s1, \
                 signed, \
                 ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
@@ -288,6 +329,7 @@ ARC_RELOC_HOWTO(ARC_SDA16_ST2, 48, \
 ARC_RELOC_HOWTO(ARC_32_PCREL, 49, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( S + A ) - PDATA ))
@@ -295,6 +337,7 @@ ARC_RELOC_HOWTO(ARC_32_PCREL, 49, \
 ARC_RELOC_HOWTO(ARC_PC32, 50, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( S + A ) - P ))
@@ -302,6 +345,7 @@ ARC_RELOC_HOWTO(ARC_PC32, 50, \
 ARC_RELOC_HOWTO(ARC_GOT32, 59, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 ( G + A ))
@@ -309,6 +353,7 @@ ARC_RELOC_HOWTO(ARC_GOT32, 59, \
 ARC_RELOC_HOWTO(ARC_GOTPC32, 51, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( ( GOT + G ) + A ) - P ))
@@ -316,6 +361,7 @@ ARC_RELOC_HOWTO(ARC_GOTPC32, 51, \
 ARC_RELOC_HOWTO(ARC_PLT32, 52, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( L + A ) - P ))
@@ -323,6 +369,7 @@ ARC_RELOC_HOWTO(ARC_PLT32, 52, \
 ARC_RELOC_HOWTO(ARC_COPY, 53, \
                 2, \
                 0, \
+                0, \
                 replace_none, \
                 signed, \
                 none)
@@ -330,6 +377,7 @@ ARC_RELOC_HOWTO(ARC_COPY, 53, \
 ARC_RELOC_HOWTO(ARC_GLOB_DAT, 54, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 S)
@@ -337,6 +385,7 @@ ARC_RELOC_HOWTO(ARC_GLOB_DAT, 54, \
 ARC_RELOC_HOWTO(ARC_JMP_SLOT, 55, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 S)
@@ -344,6 +393,7 @@ ARC_RELOC_HOWTO(ARC_JMP_SLOT, 55, \
 ARC_RELOC_HOWTO(ARC_RELATIVE, 56, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( B + A ))
@@ -351,6 +401,7 @@ ARC_RELOC_HOWTO(ARC_RELATIVE, 56, \
 ARC_RELOC_HOWTO(ARC_GOTOFF, 57, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( S + A ) - GOT ))
@@ -358,6 +409,7 @@ ARC_RELOC_HOWTO(ARC_GOTOFF, 57, \
 ARC_RELOC_HOWTO(ARC_GOTPC, 58, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 signed, \
                 ( ( GOT + A ) - P ))
@@ -365,6 +417,7 @@ ARC_RELOC_HOWTO(ARC_GOTPC, 58, \
 ARC_RELOC_HOWTO(ARC_S21W_PCREL_PLT, 60, \
                 2, \
                 19, \
+                0, \
                 replace_disp21w, \
                 signed, \
                 ( ( ( L + A ) - P ) >> 2 ))
@@ -372,6 +425,7 @@ ARC_RELOC_HOWTO(ARC_S21W_PCREL_PLT, 60, \
 ARC_RELOC_HOWTO(ARC_S25H_PCREL_PLT, 61, \
                 2, \
                 24, \
+                0, \
                 replace_disp25h, \
                 signed, \
                 ( ( ( L + A ) - P ) >> 1 ))
@@ -379,6 +433,7 @@ ARC_RELOC_HOWTO(ARC_S25H_PCREL_PLT, 61, \
 ARC_RELOC_HOWTO(ARC_TLS_DTPMOD, 66, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -386,6 +441,7 @@ ARC_RELOC_HOWTO(ARC_TLS_DTPMOD, 66, \
 ARC_RELOC_HOWTO(ARC_TLS_TPOFF, 68, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -393,6 +449,7 @@ ARC_RELOC_HOWTO(ARC_TLS_TPOFF, 68, \
 ARC_RELOC_HOWTO(ARC_TLS_GD_GOT, 69, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -400,6 +457,7 @@ ARC_RELOC_HOWTO(ARC_TLS_GD_GOT, 69, \
 ARC_RELOC_HOWTO(ARC_TLS_GD_LD, 70, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -407,6 +465,7 @@ ARC_RELOC_HOWTO(ARC_TLS_GD_LD, 70, \
 ARC_RELOC_HOWTO(ARC_TLS_GD_CALL, 71, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -414,6 +473,7 @@ ARC_RELOC_HOWTO(ARC_TLS_GD_CALL, 71, \
 ARC_RELOC_HOWTO(ARC_TLS_IE_GOT, 72, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -421,6 +481,7 @@ ARC_RELOC_HOWTO(ARC_TLS_IE_GOT, 72, \
 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF, 67, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -428,6 +489,7 @@ ARC_RELOC_HOWTO(ARC_TLS_DTPOFF, 67, \
 ARC_RELOC_HOWTO(ARC_TLS_DTPOFF_S9, 73, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -435,6 +497,7 @@ ARC_RELOC_HOWTO(ARC_TLS_DTPOFF_S9, 73, \
 ARC_RELOC_HOWTO(ARC_TLS_LE_S9, 74, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -442,6 +505,7 @@ ARC_RELOC_HOWTO(ARC_TLS_LE_S9, 74, \
 ARC_RELOC_HOWTO(ARC_TLS_LE_32, 75, \
                 2, \
                 32, \
+                0xffffffff, \
                 replace_word32, \
                 dont, \
                 0)
@@ -449,6 +513,7 @@ ARC_RELOC_HOWTO(ARC_TLS_LE_32, 75, \
 ARC_RELOC_HOWTO(ARC_S25W_PCREL_PLT, 76, \
                 2, \
                 23, \
+                0, \
                 replace_disp25w, \
                 signed, \
                 ( ( ( L + A ) - P ) >> 2 ))
@@ -456,6 +521,7 @@ ARC_RELOC_HOWTO(ARC_S25W_PCREL_PLT, 76, \
 ARC_RELOC_HOWTO(ARC_S21H_PCREL_PLT, 77, \
                 2, \
                 20, \
+                0, \
                 replace_disp21h, \
                 signed, \
                 ( ( ( L + A ) - P ) >> 1 ))
diff --git a/include/elf/arc.h b/include/elf/arc.h
index 707aeb4..246d0ff 100644
--- a/include/elf/arc.h
+++ b/include/elf/arc.h
@@ -28,7 +28,7 @@
 
 /* Relocations.  */
 
-#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
+#define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, DST_MASK, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   RELOC_NUMBER(R_##TYPE, VALUE)
 
 START_RELOC_NUMBERS (elf_arc_reloc_type)


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