From 7a174c3469a2fbde3ef227c35b9cd44be3078a2c Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Wed, 11 Oct 2017 02:39:20 +0000 Subject: [PATCH] Do exception offset computations in 64 bits, not 32. This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step closer to a clang-built world. The same change was made in later upstream binutils. Submitted by: rdivacky MFC after: 2 weeks --- contrib/binutils/bfd/elf-eh-frame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/binutils/bfd/elf-eh-frame.c b/contrib/binutils/bfd/elf-eh-frame.c index 092c2c57ec34..baa998676cdd 100644 --- a/contrib/binutils/bfd/elf-eh-frame.c +++ b/contrib/binutils/bfd/elf-eh-frame.c @@ -1344,7 +1344,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, val = read_value (abfd, buf, per_width, get_DW_EH_PE_signed (per_encoding)); - val += ent->offset - ent->new_offset; + val += (bfd_vma)ent->offset - ent->new_offset; val -= extra_string + extra_data; write_value (abfd, buf, val, per_width); action &= ~4; @@ -1400,7 +1400,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, } break; case DW_EH_PE_pcrel: - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; address += sec->output_section->vma + ent->offset + 8; break; } @@ -1428,7 +1428,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, if (value) { if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel) - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; else if (ent->cie_inf->need_lsda_relative) value -= (sec->output_section->vma + ent->new_offset + 8 + ent->lsda_offset);