diff options
author | Alan Modra <amodra@gmail.com> | 2002-11-28 11:55:43 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-11-28 11:55:43 +0000 |
commit | 947216bf8f343c1440e85633b5bf2f2394f87bc4 (patch) | |
tree | 3da37461a51d911b0778e071fc9214f5e9ffc2fe /bfd/elf64-s390.c | |
parent | 1448fa32275a8686debba9323308841480c33fc7 (diff) | |
download | gdb-947216bf8f343c1440e85633b5bf2f2394f87bc4.zip gdb-947216bf8f343c1440e85633b5bf2f2394f87bc4.tar.gz gdb-947216bf8f343c1440e85633b5bf2f2394f87bc4.tar.bz2 |
include/elf/ChangeLog
* internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr,
elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr,
Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr,
elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr,
Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym,
Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note,
elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel,
elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela,
elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela,
elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn,
Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef,
elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed,
elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux,
elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef,
Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux,
Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux,
Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym,
Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete.
(Elf_Internal_Rel): Delete.
bfd/ChangeLog
* elf-bfd.h: Replace occurrences of Elf32_Internal_* and
Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel
with Elf_Internal_Rela.
* elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
* elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr
throughout instead.
* elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
* elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
Remove INLINE keyword.
(elf_swap_reloc_in): Likewise. Also clear r_addend.
(elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
as a bfd_byte *.
(elf_write_relocs): Consolidate REL and RELA code.
(elf_slurp_reloc_table_from_section): Simplify REL code.
(NAME(_bfd_elf,size_info)): Populate reloc swap entries.
* elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
* elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
RELA code.
(elf_link_adjust_relocs): Likewise. Don't malloc space for temp
reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
(elf_link_output_relocs): Likewise.
(elf_reloc_link_order): Likewise.
(elf_finish_pointer_linker_section): Likewise.
(struct elf_link_sort_rela): Remove union.
(elf_link_sort_cmp1): Update to suit.
(elf_link_sort_cmp2): Here too.
(elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory
over-allocation for int_rels_per_ext_rel != 1 case.
* elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
* elf32-i386.c: Likewise.
* elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
* elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
* elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
* elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
elf64-sparc.c, elf64-x86-64.c: Likewise.
* elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
* elfxx-mips.c (sort_dynamic_relocs): Likewise for
bfd_elf32_swap_reloc_in.
* elf32-arm.h: Update elf32_arm_info_to_howto calls.
* elf32-mips.c: Likewise for mips_info_to_howto_rel.
(mips_elf64_swap_reloc_in): Zero r_addend.
(mips_elf64_be_swap_reloc_in): Likewise.
(mips_elf64_slurp_one_reloc_table): Simplify.
* elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
* elf64-hppa.c (hppa64_elf_size_info): Likewise.
* elf64-sparc.c (sparc64_elf_size_info): Likewise.
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r-- | bfd/elf64-s390.c | 404 |
1 files changed, 202 insertions, 202 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 296e349..31d59c7 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -606,7 +606,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) switch (ELF64_R_TYPE (rel->r_info)) { case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: case R_390_GOT32: case R_390_GOT64: case R_390_GOTENT: @@ -649,19 +649,19 @@ elf_s390_check_relocs (abfd, info, sec, relocs) } break; - case R_390_PLT16DBL: + case R_390_PLT16DBL: case R_390_PLT32: case R_390_PLT32DBL: case R_390_PLT64: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code which is + never referenced by a dynamic object, in which case we + don't need to generate a procedure linkage table entry + after all. */ /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ + creating a procedure linkage table entry. */ if (h == NULL) continue; @@ -669,12 +669,12 @@ elf_s390_check_relocs (abfd, info, sec, relocs) h->plt.refcount += 1; break; - case R_390_8: - case R_390_16: + case R_390_8: + case R_390_16: case R_390_32: case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: + case R_390_PC16: + case R_390_PC16DBL: case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: @@ -831,17 +831,17 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ - case R_390_GNU_VTINHERIT: - if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; - break; + case R_390_GNU_VTINHERIT: + if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ - case R_390_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; + case R_390_GNU_VTENTRY: + if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; default: break; @@ -1029,8 +1029,8 @@ elf_s390_adjust_dynamic_symbol (info, h) && h->root.type != bfd_link_hash_undefined)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object, or if all references were garbage collected. In + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In such a case, we don't actually need to build a procedure linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; @@ -1540,10 +1540,10 @@ elf_s390_size_dynamic_sections (output_bfd, info) } if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) + { + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) return false; /* If any dynamic relocs apply to a read-only section, @@ -1610,8 +1610,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF64_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; + || r_type == (int) R_390_GNU_VTENTRY) + continue; if (r_type < 0 || r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); @@ -1666,7 +1666,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, + input_section, rel->r_offset, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return false; @@ -1676,93 +1676,93 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, switch (r_type) { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTENT: + /* Relocation is to the entry for this symbol in the global + offset table. */ if (htab->sgot == NULL) abort (); - if (h != NULL) - { + if (h != NULL) + { boolean dyn; - off = h->got.offset; + off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + || (info->shared + && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. We must initialize + this entry in the global offset table. Since the + offset must always be a multiple of 2, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rel.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { bfd_put_64 (output_bfd, relocation, htab->sgot->contents + off); - h->got.offset |= 1; - } - } + h->got.offset |= 1; + } + } else unresolved_reloc = false; - } - else - { + } + else + { if (local_got_offsets == NULL) abort (); - off = local_got_offsets[r_symndx]; + off = local_got_offsets[r_symndx]; - /* The offset must always be a multiple of 8. We use - the least significant bit to record whether we have - already generated the necessary reloc. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_64 (output_bfd, relocation, + /* The offset must always be a multiple of 8. We use + the least significant bit to record whether we have + already generated the necessary reloc. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, htab->sgot->contents + off); - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - Elf64_External_Rela *loc; + if (info->shared) + { + asection *s; + Elf_Internal_Rela outrel; + bfd_byte *loc; - srelgot = htab->srelgot; - if (srelgot == NULL) + s = htab->srelgot; + if (s == NULL) abort (); - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation; - loc = (Elf64_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - } + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } - local_got_offsets[r_symndx] |= 1; - } - } + local_got_offsets[r_symndx] |= 1; + } + } if (off >= (bfd_vma) -2) abort (); @@ -1778,72 +1778,72 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == R_390_GOTENT) relocation += htab->sgot->output_section->vma; - break; + break; - case R_390_GOTOFF: - /* Relocation is relative to the start of the global offset - table. */ + case R_390_GOTOFF: + /* Relocation is relative to the start of the global offset + table. */ - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; + /* Note that sgot->output_offset is not involved in this + calculation. We always want the start of .got. If we + defined _GLOBAL_OFFSET_TABLE in a different way, as is + permitted by the ABI, we might have to change this + calculation. */ + relocation -= htab->sgot->output_section->vma; - break; + break; - case R_390_GOTPC: + case R_390_GOTPC: case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; + /* Use global offset table as symbol value. */ + relocation = htab->sgot->output_section->vma; unresolved_reloc = false; - break; + break; - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + case R_390_PLT16DBL: + case R_390_PLT32: + case R_390_PLT32DBL: + case R_390_PLT64: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ - /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ - if (h == NULL) - break; + /* Resolve a PLT32 reloc against a local symbol directly, + without using the procedure linkage table. */ + if (h == NULL) + break; - if (h->plt.offset == (bfd_vma) -1 + if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); unresolved_reloc = false; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: + break; + + case R_390_8: + case R_390_16: + case R_390_32: + case R_390_64: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32: case R_390_PC32DBL: - case R_390_PC64: + case R_390_PC64: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) break; - if ((info->shared + if ((info->shared && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32 @@ -1864,18 +1864,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, & ELF_LINK_HASH_DEF_REGULAR) == 0) || h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - boolean skip, relocate; + { + Elf_Internal_Rela outrel; + boolean skip, relocate; asection *sreloc; - Elf64_External_Rela *loc; + bfd_byte *loc; - /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ + /* When generating a shared object, these relocations + are copied into the output file to be resolved at run + time. */ - skip = false; - relocate = false; + skip = false; + relocate = false; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, @@ -1885,12 +1885,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, else if (outrel.r_offset == (bfd_vma) -2) skip = true, relocate = true; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); - if (skip) + if (skip) memset (&outrel, 0, sizeof outrel); - else if (h != NULL + else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 || r_type == R_390_PC16DBL @@ -1901,12 +1901,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || !info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); + { + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; - } - else - { + } + else + { /* This symbol is local, or marked to become local. */ relocate = true; outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); @@ -1917,23 +1917,23 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if (sreloc == NULL) abort (); - loc = (Elf64_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - /* If this reloc is against an external symbol, we do - not want to fiddle with the addend. Otherwise, we - need to include the symbol value so that it becomes - an addend for the dynamic reloc. */ - if (! relocate) - continue; - } + /* If this reloc is against an external symbol, we do + not want to fiddle with the addend. Otherwise, we + need to include the symbol value so that it becomes + an addend for the dynamic reloc. */ + if (! relocate) + continue; + } - break; + break; - default: - break; - } + default: + break; + } /* Dynamic relocs are not propagated for SEC_DEBUGGING sections because such sections are not SEC_ALLOC and thus ld.so will @@ -2011,10 +2011,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma plt_index; bfd_vma got_offset; Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ if (h->dynindx == -1 || htab->splt == NULL @@ -2023,11 +2023,11 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); /* Calc. index no. - Current offset - size first entry / entry size. */ + Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; /* Offset in GOT is PLT index plus GOT headers(3) times 8, - addr & GOT addr. */ + addr & GOT addr. */ got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; /* Fill in the blueprint of a PLT. */ @@ -2062,7 +2062,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) htab->splt->contents + h->plt.offset + 28); /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ + Points to instruction after GOT offset. */ bfd_put_64 (output_bfd, (htab->splt->output_section->vma + htab->splt->output_offset @@ -2076,7 +2076,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + got_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; + loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) @@ -2093,10 +2093,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) if (h->got.offset != (bfd_vma) -1) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -2115,30 +2115,30 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - { + { BFD_ASSERT((h->got.offset & 1) != 0); - rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE); - rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } + rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + rela.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } else { BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } + rela.r_addend = 0; + } - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ @@ -2153,8 +2153,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_COPY); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->srelbss->contents; + loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } @@ -2331,8 +2331,8 @@ const struct elf_size_info s390_elf64_size_info = sizeof (Elf64_External_Sym), sizeof (Elf64_External_Dyn), sizeof (Elf_External_Note), - 8, /* hash-table entry size */ - 1, /* internal relocations per external relocations */ + 8, /* hash-table entry size */ + 1, /* internal relocations per external relocations */ 64, /* arch_size */ 8, /* file_align */ ELFCLASS64, EV_CURRENT, @@ -2345,10 +2345,10 @@ const struct elf_size_info s390_elf64_size_info = bfd_elf64_slurp_symbol_table, bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out, - NULL, - NULL, - NULL, - NULL + bfd_elf64_swap_reloc_in, + bfd_elf64_swap_reloc_out, + bfd_elf64_swap_reloca_in, + bfd_elf64_swap_reloca_out }; #define TARGET_BIG_SYM bfd_elf64_s390_vec @@ -2388,6 +2388,6 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_reloc_type_class elf_s390_reloc_type_class -#define elf_backend_object_p elf_s390_object_p +#define elf_backend_object_p elf_s390_object_p #include "elf64-target.h" |