aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2008-08-24 21:43:00 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2008-08-24 21:43:00 +0000
commit9c47c4c17805edcd042a74bbd162cccc42c2dab1 (patch)
treea7df5bb0410f0ede2250c56e974475cb76e3665d /bfd/elf-eh-frame.c
parent119ac18100aab4bed2a6fdbf678adfaff4b41db6 (diff)
downloadgdb-9c47c4c17805edcd042a74bbd162cccc42c2dab1.zip
gdb-9c47c4c17805edcd042a74bbd162cccc42c2dab1.tar.gz
gdb-9c47c4c17805edcd042a74bbd162cccc42c2dab1.tar.bz2
(_bfd_elf_write_section_eh_frame): Do proper
extension when calculating difference of offsets.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r--bfd/elf-eh-frame.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 9b88499..7151a39 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1445,7 +1445,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;
@@ -1504,7 +1504,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
+ sec->output_offset
+ ent->offset + 8);
@@ -1538,7 +1538,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 (cie->u.cie.make_lsda_relative)
value -= (sec->output_section->vma
+ sec->output_offset
@@ -1577,7 +1577,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
continue;
if ((ent->fde_encoding & 0xf0) == DW_EH_PE_pcrel)
- value += ent->offset + 8 - new_offset;
+ value += (bfd_vma) ent->offset + 8 - new_offset;
if (ent->make_relative)
value -= (sec->output_section->vma
+ sec->output_offset