From 37b01f6a13f21f274bf9758ecbf5d9efd6153444 Mon Sep 17 00:00:00 2001 From: Dan Gissel Date: Fri, 11 Mar 2016 09:17:28 +0000 Subject: Fix some places where octet to byte conversions are needed. PR 19713 * elf.c (_bfd_elf_section_offset): Ensure that the returned offset uses bytes not octets. * elflink.c (resolve_section): Likewise. Add a bfd parameter. (eval_section): Pass the input_bfd to resolve_section. (bfd_elf_perform_complex_relocation): Convert byte offset to octets before read and writing values. (elf_link_input_bfd): Add byte to octet conversions. (elf_reloc_link_order): Likewise. (elf_fixup_link_order): Likewise. (bfd_elf_final_link): Likewise. * reloc.c (_bfd_final_link_relocate): Likewise. * syms.c (_bfd_stab_section_find_nearest_line): Likewise. --- bfd/syms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bfd/syms.c') diff --git a/bfd/syms.c b/bfd/syms.c index 118595d..5a22c0b 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -1083,11 +1083,13 @@ _bfd_stab_section_find_nearest_line (bfd *abfd, return FALSE; } - val = bfd_get_32 (abfd, info->stabs + r->address); + val = bfd_get_32 (abfd, info->stabs + + r->address * bfd_octets_per_byte (abfd)); val &= r->howto->src_mask; sym = *r->sym_ptr_ptr; val += sym->value + sym->section->vma + r->addend; - bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address); + bfd_put_32 (abfd, (bfd_vma) val, info->stabs + + r->address * bfd_octets_per_byte (abfd)); } } -- cgit v1.1