From b6d08fce22121e4e551dfa9ae7eb8578354685b8 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 17 Oct 1996 04:45:29 +0000 Subject: [PATCH] * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET, R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET. (elf_v850_howto_table): Corresponding changes. (elf_v850_reloc_map): Corresponding changes. * reloc.c: Add additional V850 relocations. * bfd-in2.h, libbfd.h: Rebuilt. --- bfd/ChangeLog | 8 ++++++++ bfd/bfd-in2.h | 9 +++++++++ bfd/elf32-v850.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ bfd/libbfd.h | 3 +++ bfd/reloc.c | 12 +++++++++++ 5 files changed, 84 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 29f8ff9e51c..0cb700abc23 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -6,6 +6,14 @@ Wed Oct 16 11:24:35 1996 Jeffrey A Law (law@cygnus.com) which are being discarded. start-sanitize-v850 + + * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET, + R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET. + (elf_v850_howto_table): Corresponding changes. + (elf_v850_reloc_map): Corresponding changes. + * reloc.c: Add additional V850 relocations. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we no longer want in pc-relative relocs. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 4767c0c4845..220ed5b8c05 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1864,6 +1864,15 @@ This is a 24 bit address. */ /* This is a 22-bit reloc */ BFD_RELOC_V850_22_PCREL, + +/* This is an offset from the short data area pointer.. */ + BFD_RELOC_V850_SDA_OFFSET, + +/* This is an offset from the zero data area pointer.. */ + BFD_RELOC_V850_ZDA_OFFSET, + +/* This is an offset from the tiny data area pointer.. */ + BFD_RELOC_V850_TDA_OFFSET, /* end-sanitize-v850 */ BFD_RELOC_UNUSED }; diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 1640375903d..f4c22ee42f7 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -46,6 +46,9 @@ enum reloc_type R_V850_32, R_V850_16, R_V850_8, + R_V850_SDA_OFFSET, + R_V850_ZDA_OFFSET, + R_V850_TDA_OFFSET, R_V850_max }; @@ -185,6 +188,52 @@ static reloc_howto_type elf_v850_howto_table[] = 0xff, /* src_mask */ 0xff, /* dst_mask */ false), /* pcrel_offset */ + + /* Offset from the short data area pointer. */ + HOWTO (R_V850_SDA_OFFSET, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_V850_SDA_OFFSET", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Offset from the tiny data area pointer. */ + HOWTO (R_V850_TDA_OFFSET, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_V850_TDA_OFFSET", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Offset from the zero data area pointer. */ + HOWTO (R_V850_ZDA_OFFSET, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_V850_ZDA_OFFSET", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + }; /* Map BFD reloc types to V850 ELF reloc types. */ @@ -206,6 +255,9 @@ static const struct v850_reloc_map v850_reloc_map[] = { BFD_RELOC_32, R_V850_32, }, { BFD_RELOC_16, R_V850_16, }, { BFD_RELOC_8, R_V850_8, }, + { BFD_RELOC_V850_TDA_OFFSET, R_V850_TDA_OFFSET, }, + { BFD_RELOC_V850_SDA_OFFSET, R_V850_SDA_OFFSET, }, + { BFD_RELOC_V850_ZDA_OFFSET, R_V850_ZDA_OFFSET, }, }; static reloc_howto_type * diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 02d127918d8..aa3dd61cdb6 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -756,6 +756,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", /* start-sanitize-v850 */ "BFD_RELOC_V850_9_PCREL", "BFD_RELOC_V850_22_PCREL", + "BFD_RELOC_V850_SDA_OFFSET", + "BFD_RELOC_V850_ZDA_OFFSET", + "BFD_RELOC_V850_TDA_OFFSET", /* end-sanitize-v850 */ "@@overflow: BFD_RELOC_UNUSED@@", diff --git a/bfd/reloc.c b/bfd/reloc.c index cf0674af138..20be20d7dce 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2281,6 +2281,18 @@ ENUM BFD_RELOC_V850_22_PCREL ENUMDOC This is a 22-bit reloc +ENUM + BFD_RELOC_V850_SDA_OFFSET +ENUMDOC + This is an offset from the short data area pointer.. +ENUM + BFD_RELOC_V850_ZDA_OFFSET +ENUMDOC + This is an offset from the zero data area pointer.. +ENUM + BFD_RELOC_V850_TDA_OFFSET +ENUMDOC + This is an offset from the tiny data area pointer.. COMMENT {* end-sanitize-v850 *} -- 2.30.2