projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace "if (x) free (x)" with "free (x)", bfd
[deliverable/binutils-gdb.git]
/
bfd
/
elf-m10200.c
diff --git
a/bfd/elf-m10200.c
b/bfd/elf-m10200.c
index aef1b526a5a0e0efdb3a5af5d31e4770e049df0c..58c1515ce89a34936dcd17e26e5ef73c98414bd9 100644
(file)
--- a/
bfd/elf-m10200.c
+++ b/
bfd/elf-m10200.c
@@
-1,5
+1,5
@@
/* Matsushita 10200 specific support for 32-bit ELF
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright (C) 1996-20
17
Free Software Foundation, Inc.
+ Copyright (C) 1996-20
20
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
@@
-212,16
+212,25
@@
bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
/* Set the howto pointer for an MN10200 ELF reloc. */
/* Set the howto pointer for an MN10200 ELF reloc. */
-static
void
-mn10200_info_to_howto (bfd *abfd
ATTRIBUTE_UNUSED
,
+static
bfd_boolean
+mn10200_info_to_howto (bfd *abfd,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_MN10200_MAX);
+ if (r_type >= (unsigned int) R_MN10200_MAX)
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
cache_ptr->howto = &elf_mn10200_howto_table[r_type];
cache_ptr->howto = &elf_mn10200_howto_table[r_type];
+ return cache_ptr->howto != NULL;
}
/* Perform a relocation as part of a final link. */
}
/* Perform a relocation as part of a final link. */
@@
-404,7
+413,7
@@
mn10200_elf_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (
input_bfd,
sec);
+ name = bfd_section_name (sec);
}
switch (r)
}
switch (r)
@@
-1198,21
+1207,17
@@
mn10200_elf_relax_section (bfd *abfd,
}
}
}
}
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
return TRUE;
error_return:
free (internal_relocs);
return TRUE;
error_return:
- if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
free (isymbuf);
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
free (contents);
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
return FALSE;
free (internal_relocs);
return FALSE;
@@
-1346,10
+1351,8
@@
mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
isymbuf, sections))
goto error_return;
isymbuf, sections))
goto error_return;
- if (sections != NULL)
- free (sections);
- if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
+ free (sections);
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
if (elf_section_data (input_section)->relocs != internal_relocs)
free (internal_relocs);
free (isymbuf);
if (elf_section_data (input_section)->relocs != internal_relocs)
free (internal_relocs);
@@
-1358,13
+1361,10
@@
mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
return data;
error_return:
return data;
error_return:
- if (sections != NULL)
- free (sections);
- if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
+ free (sections);
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
free (isymbuf);
- if (internal_relocs != NULL
- && elf_section_data (input_section)->relocs != internal_relocs)
+ if (elf_section_data (input_section)->relocs != internal_relocs)
free (internal_relocs);
return NULL;
}
free (internal_relocs);
return NULL;
}
@@
-1378,7
+1378,7
@@
mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
#define elf_backend_rela_normal 1
#define elf_info_to_howto mn10200_info_to_howto
#define elf_backend_rela_normal 1
#define elf_info_to_howto mn10200_info_to_howto
-#define elf_info_to_howto_rel
0
+#define elf_info_to_howto_rel
NULL
#define elf_backend_relocate_section mn10200_elf_relocate_section
#define bfd_elf32_bfd_relax_section mn10200_elf_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
#define elf_backend_relocate_section mn10200_elf_relocate_section
#define bfd_elf32_bfd_relax_section mn10200_elf_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
This page took
0.038767 seconds
and
4
git commands to generate.