aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-12 06:21:05 +0000
committerAlan Modra <amodra@gmail.com>2002-11-12 06:21:05 +0000
commit99eb2ac83dc99f32cf4eec92071756c3aaf6582c (patch)
treeb301cc577f03f7b037d2a0b309196a054c390c9e /bfd/elf-eh-frame.c
parent852f55ac64a8aacd9bcfd59a044041db2919c563 (diff)
downloadgdb-99eb2ac83dc99f32cf4eec92071756c3aaf6582c.zip
gdb-99eb2ac83dc99f32cf4eec92071756c3aaf6582c.tar.gz
gdb-99eb2ac83dc99f32cf4eec92071756c3aaf6582c.tar.bz2
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
relocs for discarded FDEs. Remove dead code. (_bfd_elf_write_section_eh_frame_hdr): Remove dead code. * elflink.h (elf_bfd_discard_info): Don't save edited relocs. Tidy conditions under which stabs are edited. Formatting. * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows from discarded relocs. * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output section adjustments after testing magic values.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r--bfd/elf-eh-frame.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index b6d2d2f..d5f4cc5 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -299,7 +299,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
unsigned int leb128_tmp;
unsigned int cie_usage_count, last_cie_ndx, i, offset;
unsigned int make_relative, make_lsda_relative;
- Elf_Internal_Rela *rel;
bfd_size_type new_size;
unsigned int ptr_size;
@@ -555,10 +554,9 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
+ ((buf - ehbuf + per_width - 1)
& ~((bfd_size_type) per_width - 1)));
ENSURE_NO_RELOCS (buf);
- rel = GET_RELOC (buf);
/* Ensure we have a reloc here, against
a global symbol. */
- if (rel != NULL)
+ if (GET_RELOC (buf) != NULL)
{
unsigned long r_symndx;
@@ -626,8 +624,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
goto free_no_table;
ENSURE_NO_RELOCS (buf);
- rel = GET_RELOC (buf);
- if (rel == NULL)
+ if (GET_RELOC (buf) == NULL)
/* This should not happen. */
goto free_no_table;
if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie))
@@ -636,7 +633,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
be deleted. */
new_size -= hdr.length + 4;
sec_info->entry[sec_info->count].removed = 1;
- memset (rel, 0, sizeof (*rel));
}
else
{
@@ -654,7 +650,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
cie_usage_count++;
hdr_info->fde_count++;
}
- cookie->rel = rel;
if (cie.lsda_encoding != DW_EH_PE_omit)
{
unsigned int dummy;
@@ -751,10 +746,6 @@ _bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec)
asection *sec;
{
struct eh_frame_hdr_info *hdr_info;
- unsigned int ptr_size;
-
- ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS]
- == ELFCLASS64) ? 8 : 4;
if ((elf_section_data (sec)->sec_info_type
!= ELF_INFO_TYPE_EH_FRAME_HDR)
@@ -1179,14 +1170,10 @@ _bfd_elf_write_section_eh_frame_hdr (abfd, sec)
asection *sec;
{
struct eh_frame_hdr_info *hdr_info;
- unsigned int ptr_size;
bfd_byte *contents;
asection *eh_frame_sec;
bfd_size_type size;
- ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS]
- == ELFCLASS64) ? 8 : 4;
-
BFD_ASSERT (elf_section_data (sec)->sec_info_type
== ELF_INFO_TYPE_EH_FRAME_HDR);
hdr_info = (struct eh_frame_hdr_info *)