aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-loongarch.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-07 22:43:20 +0930
committerAlan Modra <amodra@gmail.com>2022-06-08 21:33:00 +0930
commitc94cb026628b831ef63e3455a66328749ff8a415 (patch)
tree57ee202b558b82c12ea74e0621928d80008f160d /bfd/elfxx-loongarch.c
parent3418a349c624257d6a47a299901b9e996469acba (diff)
downloadgdb-c94cb026628b831ef63e3455a66328749ff8a415.zip
gdb-c94cb026628b831ef63e3455a66328749ff8a415.tar.gz
gdb-c94cb026628b831ef63e3455a66328749ff8a415.tar.bz2
HOWTO size encoding
This changes the HOWTO macro to encode the howto.size field from a value given in bytes. This of course requires editing all target uses of HOWTO, a major pain, but makes it a little nicer to specify new target HOWTOs. Object files before/after this patch are unchanged in .data and .rodata. bfd/ * reloc.c (HOWTO_RSIZE): Encode size in bytes. (EMPTY_HOWTO): Adjust to keep it all zero. * aout-ns32k.c, * aoutx.h, * coff-alpha.c, * coff-arm.c, * coff-i386.c, * coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c, * elf32-h8300.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh-relocs.h, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-gen.c, * elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfxx-ia64.c, * elfxx-loongarch.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-x86-64.c, * pdp11.c, * reloc.c, * som.c, * vms-alpha.c: Adjust all uses of HOWTO. * bfd-in2.h: Regenerate. include/ * elf/arc-reloc.def: Adjust all uses of HOWTO.
Diffstat (limited to 'bfd/elfxx-loongarch.c')
-rw-r--r--bfd/elfxx-loongarch.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/bfd/elfxx-loongarch.c b/bfd/elfxx-loongarch.c
index 6f7c822..362da2e 100644
--- a/bfd/elfxx-loongarch.c
+++ b/bfd/elfxx-loongarch.c
@@ -38,7 +38,7 @@ typedef struct loongarch_reloc_howto_type_struct
}loongarch_reloc_howto_type;
#define LOONGARCH_DEFAULT_HOWTO(r_name) \
- { HOWTO (R_LARCH_##r_name, 0, 2, 32, false, 0, complain_overflow_signed, \
+ { HOWTO (R_LARCH_##r_name, 0, 4, 32, false, 0, complain_overflow_signed, \
bfd_elf_generic_reloc, "R_LARCH_" #r_name, false, 0, ALL_ONES, \
false), BFD_RELOC_LARCH_##r_name, NULL }
@@ -64,7 +64,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
/* No relocation. */
LOONGARCH_HOWTO (R_LARCH_NONE, /* type (0). */
0, /* rightshift */
- 3, /* size */
+ 0, /* size */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -81,7 +81,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
/* 32 bit relocation. */
LOONGARCH_HOWTO (R_LARCH_32, /* type (1). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -98,7 +98,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
/* 64 bit relocation. */
LOONGARCH_HOWTO (R_LARCH_64, /* type (2). */
0, /* rightshift */
- 4, /* size */
+ 8, /* size */
64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -114,7 +114,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_RELATIVE, /* type (3). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -130,7 +130,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_COPY, /* type (4). */
0, /* rightshift */
- 0, /* this one is variable size */
+ 1, /* this one is variable size */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -146,7 +146,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_JUMP_SLOT, /* type (5). */
0, /* rightshift */
- 4, /* size */
+ 8, /* size */
64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -163,7 +163,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
/* Dynamic TLS relocations. */
LOONGARCH_HOWTO (R_LARCH_TLS_DTPMOD32, /* type (6). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -179,7 +179,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_TLS_DTPMOD64, /* type (7). */
0, /* rightshift */
- 4, /* size */
+ 8, /* size */
64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -195,7 +195,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_TLS_DTPREL32, /* type (8). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -211,7 +211,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_TLS_DTPREL64, /* type (9). */
0, /* rightshift */
- 4, /* size */
+ 8, /* size */
64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -227,7 +227,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_TLS_TPREL32, /* type (10). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -243,7 +243,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_TLS_TPREL64, /* type (11). */
0, /* rightshift */
- 4, /* size */
+ 8, /* size */
64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -259,7 +259,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_IRELATIVE, /* type (12). */
0, /* rightshift */
- 2, /* size */
+ 4, /* size */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -283,7 +283,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_MARK_LA, /* type (20). */
0, /* rightshift. */
- 3, /* size. */
+ 0, /* size. */
0, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -299,7 +299,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_MARK_PCREL, /* type (21). */
0, /* rightshift. */
- 3, /* size. */
+ 0, /* size. */
0, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -315,7 +315,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_PUSH_PCREL, /* type (22). */
2, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
32, /* bitsize. */
true /* FIXME: somewhat use this. */, /* pc_relative. */
0, /* bitpos. */
@@ -348,7 +348,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_10_5, /* type (38). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
5, /* bitsize. */
false, /* pc_relative. */
10, /* bitpos. */
@@ -364,7 +364,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_U_10_12, /* type (39). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
12, /* bitsize. */
false, /* pc_relative. */
10, /* bitpos. */
@@ -380,7 +380,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_10_12, /* type (40). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
12, /* bitsize. */
false, /* pc_relative. */
10, /* bitpos. */
@@ -396,7 +396,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_10_16, /* type (41). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
16, /* bitsize. */
false, /* pc_relative. */
10, /* bitpos. */
@@ -412,7 +412,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_10_16_S2, /* type (42). */
2, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
16, /* bitsize. */
false, /* pc_relative. */
10, /* bitpos. */
@@ -428,7 +428,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_5_20, /* type (43). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
20, /* bitsize. */
false, /* pc_relative. */
5, /* bitpos. */
@@ -445,7 +445,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_0_5_10_16_S2,
/* type (44). */
2, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
21, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -462,7 +462,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_S_0_10_10_16_S2, /* type (45). */
2, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
26, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -479,7 +479,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SOP_POP_32_U, /* type (46). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
32, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -495,7 +495,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_ADD8, /* type (47). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
8, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -511,7 +511,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_ADD16, /* type (48). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
16, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -527,7 +527,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_ADD24, /* type (49). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
24, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -543,7 +543,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_ADD32, /* type (50). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
32, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -559,7 +559,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_ADD64, /* type (51). */
0, /* rightshift. */
- 4, /* size. */
+ 8, /* size. */
64, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -575,7 +575,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SUB8, /* type (52). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
8, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -591,7 +591,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SUB16, /* type (53). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
16, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -607,7 +607,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SUB24, /* type (54). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
24, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -623,7 +623,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SUB32, /* type (55). */
0, /* rightshift. */
- 2, /* size. */
+ 4, /* size. */
32, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -639,7 +639,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_SUB64, /* type (56). */
0, /* rightshift. */
- 4, /* size. */
+ 8, /* size. */
64, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -655,7 +655,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_GNU_VTINHERIT, /* type (57). */
0, /* rightshift. */
- 0, /* size. */
+ 1, /* size. */
0, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */
@@ -671,7 +671,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
LOONGARCH_HOWTO (R_LARCH_GNU_VTENTRY, /* type (58). */
0, /* rightshift. */
- 0, /* size. */
+ 1, /* size. */
0, /* bitsize. */
false, /* pc_relative. */
0, /* bitpos. */