aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 368594d..03b6c24 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -205,7 +205,7 @@ elf_file_symbol (const char *s)
if (name_length > strlen (S_GET_NAME (sym)))
{
obstack_grow (&notes, s, name_length + 1);
- S_SET_NAME (sym, (const char *) obstack_finish (&notes));
+ S_SET_NAME (sym, obstack_finish (&notes));
}
else
strcpy ((char *) S_GET_NAME (sym), s);
@@ -481,7 +481,7 @@ match_section (const asection *sec, const struct elf_section_match *match)
static bool
get_section_by_match (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf)
{
- struct elf_section_match *match = (struct elf_section_match *) inf;
+ struct elf_section_match *match = inf;
const char *gname = match->group_name;
const char *group_name = elf_group_name (sec);
@@ -614,7 +614,7 @@ change_section (const char *name,
old_sec = group_section_find (match_p, name, &group_idx);
else
old_sec = bfd_get_section_by_name_if (stdoutput, name, get_section_by_match,
- (void *) match_p);
+ match_p);
if (old_sec)
{
sec = old_sec;
@@ -942,13 +942,12 @@ obj_elf_parse_section_letters (char *str, size_t len,
if (ISDIGIT (*str))
{
char * end;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_vma numeric_flags = strtoul (str, &end, 0);
attr |= numeric_flags;
- bed = (struct elf_backend_data *)
- get_elf_backend_data (stdoutput);
+ bed = get_elf_backend_data (stdoutput);
if (bed->elf_osabi == ELFOSABI_NONE
|| bed->elf_osabi == ELFOSABI_STANDALONE
@@ -1229,7 +1228,7 @@ obj_elf_section (int push)
if (push && ISDIGIT (*input_line_pointer))
{
/* .pushsection has an optional subsection. */
- new_subsection = (subsegT) get_absolute_expression ();
+ new_subsection = get_absolute_expression ();
SKIP_WHITESPACE ();
@@ -1460,7 +1459,7 @@ obj_elf_section (int push)
char *t = input_line_pointer;
match.sh_info = strtoul (input_line_pointer,
&input_line_pointer, 0);
- if (match.sh_info == (unsigned int) -1)
+ if (match.sh_info == -1u)
{
as_warn (_("unsupported mbind section info: %s"), t);
match.sh_info = 0;
@@ -1497,8 +1496,7 @@ obj_elf_section (int push)
errno = 0;
id = strtoul (input_line_pointer,
&input_line_pointer, 0);
- overflow = (id == (unsigned long) -1
- && errno == ERANGE);
+ overflow = id == -1ul && errno == ERANGE;
}
else
{
@@ -1507,7 +1505,7 @@ obj_elf_section (int push)
(const char **) &input_line_pointer, 0);
overflow = id == ~(bfd_vma) 0;
}
- if (overflow || id > (unsigned int) -1)
+ if (overflow || id > -1u)
{
char *linefeed, saved_char = 0;
if ((linefeed = strchr (t, '\n')) != NULL)
@@ -1614,7 +1612,7 @@ obj_elf_bss (int i ATTRIBUTE_UNUSED)
obj_elf_section_change_hook ();
temp = get_absolute_expression ();
- subseg_set (bss_section, (subsegT) temp);
+ subseg_set (bss_section, temp);
demand_empty_rest_of_line ();
#ifdef md_elf_section_change_hook
@@ -1688,7 +1686,7 @@ obj_elf_subsection (int ignore ATTRIBUTE_UNUSED)
obj_elf_section_change_hook ();
temp = get_absolute_expression ();
- subseg_set (now_seg, (subsegT) temp);
+ subseg_set (now_seg, temp);
demand_empty_rest_of_line ();
#ifdef md_elf_section_change_hook
@@ -2691,7 +2689,7 @@ set_additional_section_info (bfd *abfd,
if (!strcmp ("str", sec->name + strlen (sec->name) - 3))
return;
- name = concat (sec->name, "str", NULL);
+ name = concat (sec->name, "str", (const char *) NULL);
strsec = bfd_get_section_by_name (abfd, name);
if (strsec)
strsz = bfd_section_size (strsec);