This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Another .eh_frame fix
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: davem at redhat dot com
- Date: Mon, 22 Apr 2002 19:52:09 +0200
- Subject: [PATCH] Another .eh_frame fix
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This should fix SPARC gcc-3.1 invokethrow failure.
Will try to cook up some testcases in the evening.
2002-04-22 Jakub Jelinek <jakub@redhat.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
search table if some FDE is DW_EH_PE_aligned encoded either.
(_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
--- bfd/elf-eh-frame.c.jj Mon Apr 22 13:57:23 2002
+++ bfd/elf-eh-frame.c Mon Apr 22 19:49:44 2002
@@ -636,8 +636,9 @@ _bfd_elf_discard_section_eh_frame (abfd,
else
{
if (info->shared
- && (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr
- && cie.make_relative == 0)
+ && (((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr
+ && cie.make_relative == 0)
+ || (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned))
{
/* If shared library uses absolute pointers
which we cannot turn into PC relative,
@@ -1026,7 +1027,7 @@ _bfd_elf_write_section_eh_frame (abfd, s
}
}
}
- else
+ else if (sec_info->entry[i].size > 4)
{
/* FDE */
bfd_vma value = 0, address;
@@ -1099,6 +1100,9 @@ _bfd_elf_write_section_eh_frame (abfd, s
}
}
}
+ else
+ /* Terminating FDE must be at the end of .eh_frame section only. */
+ BFD_ASSERT (i == sec_info->count - 1);
BFD_ASSERT (p == contents + sec_info->entry[i].new_offset);
memmove (p, contents + sec_info->entry[i].offset,
Jakub