#include "elf-bfd.h"
#include "elf/i370.h"
-#define USE_RELA /* we want RELA relocations, not REL */
-
-/* i370 relocations */
-/* Note that there is really just one relocation that we currently
- * support (and only one that we seem to need, at the moment), and
- * that is the 31-bit address relocation. Note that the 370/390
- * only supports a 31-bit (2GB) address space.
- */
-enum i370_reloc_type
-{
- R_I370_NONE = 0,
- R_I370_ADDR31 = 1,
- R_I370_ADDR32 = 2,
- R_I370_ADDR16 = 3,
- R_I370_REL31 = 4,
- R_I370_REL32 = 5,
- R_I370_ADDR12 = 6,
- R_I370_REL12 = 7,
- R_I370_ADDR8 = 8,
- R_I370_REL8 = 9,
- R_I370_COPY = 10,
- R_I370_RELATIVE = 11,
-
- R_I370_max
-};
-\f
static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ];
static reloc_howto_type i370_elf_howto_raw[] =
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr,
- Elf32_Internal_Rela *dst));
+ Elf_Internal_Rela *dst));
static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword));
\f
/* Initialize the i370_elf_howto_table, so that linear accesses can be done. */
struct bfd_link_info *));
static boolean i370_elf_section_from_shdr PARAMS ((bfd *,
- Elf32_Internal_Shdr *,
- char *));
+ Elf_Internal_Shdr *,
+ const char *));
static boolean i370_elf_fake_sections PARAMS ((bfd *,
- Elf32_Internal_Shdr *,
+ Elf_Internal_Shdr *,
asection *));
#if 0
static elf_linker_section_t *i370_elf_create_linker_section
i370_elf_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
- Elf32_Internal_Rela *dst;
+ Elf_Internal_Rela *dst;
{
if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table */
i370_elf_howto_init ();
static boolean
i370_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
- Elf32_Internal_Shdr *hdr;
- char *name;
+ Elf_Internal_Shdr *hdr;
+ const char *name;
{
asection *newsect;
flagword flags;
static boolean
i370_elf_fake_sections (abfd, shdr, asect)
bfd *abfd ATTRIBUTE_UNUSED;
- Elf32_Internal_Shdr *shdr;
+ Elf_Internal_Shdr *shdr;
asection *asect;
{
if ((asect->flags & SEC_EXCLUDE) != 0)
&& r_symndx != 0)
{
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
int skip;
#ifdef DEBUG
}
}
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
need to do anything now, unless this is a RELATIVE