aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-02-13 13:14:47 +0000
committerNick Clifton <nickc@redhat.com>2018-02-13 13:14:47 +0000
commit68d206766637a041bbbeb89c8a1bfdd76317e192 (patch)
tree435e8bb00be52ac286ba5cce2c9a99a5f6b3e71d /gas
parentb29d26411c62fef6b1401aff4f2c6a157053de4d (diff)
downloadgdb-68d206766637a041bbbeb89c8a1bfdd76317e192.zip
gdb-68d206766637a041bbbeb89c8a1bfdd76317e192.tar.gz
gdb-68d206766637a041bbbeb89c8a1bfdd76317e192.tar.bz2
Fix compile time warning messages from gcc version 8 about cast between incompatible function types.
PR 22823 bfd Fix compile time warnings generated by gcc version 8. * libbfd-in.h: Remove extraneous text from prototypes. Add prototypes for bfd_false_any, bfd_true_any, bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any, bfd_n1_any, bfd_void_any. (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy function. (_bfd_generic_bfd_merge_private_bfd_data): Likewise. (_bfd_generic_bfd_set_private_flags): Likewise. (_bfd_generic_bfd_copy_private_section_data): Likewise. (_bfd_generic_bfd_copy_private_symbol_data): Likewise. (_bfd_generic_bfd_copy_private_header_data): Likewise. (_bfd_generic_bfd_print_private_bfd_data): Likewise. (_bfd_noarchive_construct_extended_name_table): Likewise. (_bfd_noarchive_truncate_arname): Likewise. (_bfd_noarchive_write_ar_hdr): Likewise. (_bfd_noarchive_get_elt_at_index): Likewise. (_bfd_nosymbols_canonicalize_symtab): Likewise. (_bfd_nosymbols_print_symbol): Likewise. (_bfd_nosymbols_get_symbol_info): Likewise. (_bfd_nosymbols_get_symbol_version_string): Likewise. (_bfd_nosymbols_bfd_is_local_label_name): Likewise. (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise. (_bfd_nosymbols_get_lineno): Likewise. (_bfd_nosymbols_find_nearest_line): Likewise. (_bfd_nosymbols_find_line): Likewise. (_bfd_nosymbols_find_inliner_info): Likewise. (_bfd_nosymbols_bfd_make_debug_symbol): Likewise. (_bfd_nosymbols_read_minisymbols): Likewise. (_bfd_nosymbols_minisymbol_to_symbol): Likewise. (_bfd_norelocs_bfd_reloc_type_lookup): Likewise. (_bfd_norelocs_bfd_reloc_name_lookup): Likewise. (_bfd_nowrite_set_arch_mach): Likewise. (_bfd_nowrite_set_section_contents): Likewise. (_bfd_nolink_sizeof_headers): Likewise. (_bfd_nolink_bfd_get_relocated_section_contents): Likewise. (_bfd_nolink_bfd_relax_section): Likewise. (_bfd_nolink_bfd_gc_sections): Likewise. (_bfd_nolink_bfd_lookup_section_flags): Likewise. (_bfd_nolink_bfd_merge_sections): Likewise. (_bfd_nolink_bfd_is_group_section): Likewise. (_bfd_nolink_bfd_discard_group): Likewise. (_bfd_nolink_bfd_link_hash_table_create): Likewise. (_bfd_nolink_bfd_link_add_symbols): Likewise. (_bfd_nolink_bfd_link_just_syms): Likewise. (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise. (_bfd_nolink_bfd_final_link): Likewise. (_bfd_nolink_bfd_link_split_section): Likewise. (_bfd_nolink_section_already_linked): Likewise. (_bfd_nolink_bfd_define_common_symbol): Likewise. (_bfd_nolink_bfd_define_start_stop): Likewise. (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise. (_bfd_nodynamic_get_synthetic_symtab): Likewise. (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise. (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise. * libbfd.c (bfd_false_any): New function. Like bfd_false but accepts one or more arguments. (bfd_true_any): Likewise. (bfd_nullvoidptr_any): Likewise. (bfd_0_any): Likewise. (bfd_0u_any): Likewise. (bfd_0l_any): Likewise. (_bfd_n1_any): Likewise. (bfd_void_any): Likewise. * libbfd.h (extern): Regenerate * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg based dummy function. * aout-tic30.c (tic30_aout_set_arch_mach): Likewise. * binary.c (binary_get_symbol_info): Likewise. * coff-alpha.c (alpha_ecoff_backend_data): Likewise. * coff-mips.c (mips_ecoff_backend_data): Likewise. * coffcode.h (coff_set_alignment_hook): Likewise. (symname_in_debug_hook): Likewise. (bfd_coff_backend_data bigobj_swap_table): Likewise. * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise. * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise. * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise. * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise. * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise. * elf32-score.c (elf_backend_omit_section_dynsym): Likewise. * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise. * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise. * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise. * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise. * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise. * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise. * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise. * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise. * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise. * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise. (bfd_elfNN_bfd_make_debug_symbol): Likewise. (bfd_elfNN_bfd_merge_private_bfd_data): Likewise. (bfd_elfNN_bfd_set_private_flags): Likewise. (bfd_elfNN_bfd_is_target_special_symbol): Likewise. (elf_backend_init_index_section): Likewise. (elf_backend_allow_non_load_phdr): Likewise. * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise. * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise. * ieee.c (ieee_construct_extended_name_table): Likewise. (ieee_write_armap): Likewise. (ieee_write_ar_hdr): Likewise. (ieee_bfd_is_target_special_symbol): Likewise. * ihex.c (ihex_canonicalize_symtab): Likewise. (ihex_bfd_is_target_special_symbol): Likewise. * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise. * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise. (_bfd_ecoff_set_alignment_hook): Likewise. * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise. * mmo.c (mmo_bfd_is_target_special_symbol): Likewise. * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise. * oasys.c (oasys_construct_extended_name_table): Likewise. (oasys_write_armap): Likewise. (oasys_write_ar_hdr): Likewise. (oasys_bfd_is_target_special_symbol): Likewise. * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise. * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise. * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise. * som.c (som_bfd_is_target_special_symbol): Likewise. * srec.c (srec_bfd_is_target_special_symbol): Likewise. * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise. * verilog.c (verilog_bfd_is_target_special_symbol): Likewise. * versados.c (versados_bfd_is_target_special_symbol): Likewise. (versados_bfd_reloc_name_lookup): Likewise. * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise. (vms_bfd_define_start_stop): Likewise. (alpha_vms_bfd_is_target_special_symbol): Likewise. * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise. * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise. * elf32-arc.c (get_replace_function): Assign replacement function to func pointer. * elf32-i370.c (i370_noop): Update prototype. gas * config/obj-elf.c (elf_pseudo_table): Remove now redundant casts. (obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit. (obj_elf_vtable_inherit): New stub function that calls obj_elf_get_vtable_inherit. (obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry. (obj_elf_vtable_entry): New stub function that calls obj_elf_get_vtable_entry. * config/obj-elf.h (obj_elf_vtable_inherit): Update prototype. (obj_elf_vtable_entry) Likewise. (obj_elf_get_vtable_inherit) Likewise. (obj_elf_get_vtable_entry) Likewise. * config/tc-arm.c (md_pseudo_table): Remove now redundant cast. * config/tc-i386c (md_pseudo_table): Likewise. * config/tc-hppa.c (pa_vtable_entry): Call obj_elf_get_vtable_entry. (pa_vtable_inherit): Call obj_elf_get_vtable_inherit. * config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file with call to dwarf2_get_filename. * dwarf2dbg.c (dwarf2_directive_file): Rename to dwarf2_directive_filename. (dwarf2_directive_file): New stub function that calls dwarf2_directive_filename. * dwarf2dbg.h: Prototype dwarf2_directive_filename. opcodes * metag-dis.c (print_fmmov): Double buffer size to avoid warning about truncation of printing.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog28
-rw-r--r--gas/config/obj-elf.c28
-rw-r--r--gas/config/obj-elf.h6
-rw-r--r--gas/config/tc-arm.c2
-rw-r--r--gas/config/tc-hppa.c4
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/config/tc-mips.c2
-rw-r--r--gas/dwarf2dbg.c13
-rw-r--r--gas/dwarf2dbg.h6
9 files changed, 75 insertions, 16 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fc4cd6f..97b3581 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -2,6 +2,34 @@
* testsuite/gas/mips/loongson-3a-2.d: Rename test.
+2018-02-13 Nick Clifton <nickc@redhat.com>
+
+ PR 22823
+ * config/obj-elf.c (elf_pseudo_table): Remove now redundant
+ casts.
+ (obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit.
+ (obj_elf_vtable_inherit): New stub function that calls
+ obj_elf_get_vtable_inherit.
+ (obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry.
+ (obj_elf_vtable_entry): New stub function that calls
+ obj_elf_get_vtable_entry.
+ * config/obj-elf.h (obj_elf_vtable_inherit): Update prototype.
+ (obj_elf_vtable_entry) Likewise.
+ (obj_elf_get_vtable_inherit) Likewise.
+ (obj_elf_get_vtable_entry) Likewise.
+ * config/tc-arm.c (md_pseudo_table): Remove now redundant cast.
+ * config/tc-i386c (md_pseudo_table): Likewise.
+ * config/tc-hppa.c (pa_vtable_entry): Call
+ obj_elf_get_vtable_entry.
+ (pa_vtable_inherit): Call obj_elf_get_vtable_inherit.
+ * config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file
+ with call to dwarf2_get_filename.
+ * dwarf2dbg.c (dwarf2_directive_file): Rename to
+ dwarf2_directive_filename.
+ (dwarf2_directive_file): New stub function that calls
+ dwarf2_directive_filename.
+ * dwarf2dbg.h: Prototype dwarf2_directive_filename.
+
2018-02-12 Maciej W. Rozycki <macro@mips.com>
* testsuite/gas/mips/reginfo-2-n32.d: Add `--no-pad-sections' to
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index ae9b2e1..cac3c39a 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -117,8 +117,8 @@ static const pseudo_typeS elf_pseudo_table[] =
{"subsection", obj_elf_subsection, 0},
/* These are GNU extensions to aid in garbage collecting C++ vtables. */
- {"vtable_inherit", (void (*) (int)) &obj_elf_vtable_inherit, 0},
- {"vtable_entry", (void (*) (int)) &obj_elf_vtable_entry, 0},
+ {"vtable_inherit", obj_elf_vtable_inherit, 0},
+ {"vtable_entry", obj_elf_vtable_entry, 0},
/* A GNU extension for object attributes. */
{"gnu_attribute", obj_elf_gnu_attribute, 0},
@@ -128,7 +128,7 @@ static const pseudo_typeS elf_pseudo_table[] =
{"4byte", cons, 4},
{"8byte", cons, 8},
/* These are used for dwarf2. */
- { "file", (void (*) (int)) dwarf2_directive_file, 0 },
+ { "file", dwarf2_directive_file, 0 },
{ "loc", dwarf2_directive_loc, 0 },
{ "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 },
@@ -1460,7 +1460,7 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED)
syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */
struct fix *
-obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
+obj_elf_get_vtable_inherit (void)
{
char *cname, *pname;
symbolS *csym, *psym;
@@ -1524,12 +1524,21 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT);
}
+/* This is a version of obj_elf_get_vtable_inherit() that is
+ suitable for use in struct _pseudo_type tables. */
+
+void
+obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
+{
+ (void) obj_elf_get_vtable_inherit ();
+}
+
/* This handles the .vtable_entry pseudo-op, which is used to indicate
to the linker that a vtable slot was used. The syntax is
".vtable_entry tablename, offset". */
struct fix *
-obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED)
+obj_elf_get_vtable_entry (void)
{
symbolS *sym;
offsetT offset;
@@ -1557,6 +1566,15 @@ obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED)
BFD_RELOC_VTABLE_ENTRY);
}
+/* This is a version of obj_elf_get_vtable_entry() that is
+ suitable for use in struct _pseudo_type tables. */
+
+void
+obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED)
+{
+ (void) obj_elf_get_vtable_entry ();
+}
+
#define skip_whitespace(str) do { if (*(str) == ' ') ++(str); } while (0)
static inline int
diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h
index 33e0954..96f7cbc 100644
--- a/gas/config/obj-elf.h
+++ b/gas/config/obj-elf.h
@@ -164,8 +164,10 @@ extern void obj_elf_text (int);
extern void obj_elf_change_section
(const char *, unsigned int, unsigned int, bfd_vma, int, const char *,
int, int);
-extern struct fix *obj_elf_vtable_inherit (int);
-extern struct fix *obj_elf_vtable_entry (int);
+extern void obj_elf_vtable_inherit (int);
+extern void obj_elf_vtable_entry (int);
+extern struct fix * obj_elf_get_vtable_inherit (void);
+extern struct fix * obj_elf_get_vtable_entry (void);
extern bfd_boolean obj_elf_seen_attribute
(int, unsigned int);
extern int obj_elf_vendor_attribute (int);
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ec50420..9786f14 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -4758,7 +4758,7 @@ const pseudo_typeS md_pseudo_table[] =
{"4byte", cons, 4},
{"8byte", cons, 8},
/* These are used for dwarf2. */
- { "file", (void (*) (int)) dwarf2_directive_file, 0 },
+ { "file", dwarf2_directive_file, 0 },
{ "loc", dwarf2_directive_loc, 0 },
{ "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 },
#endif
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index f18aab6..e69fdb2 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -8528,7 +8528,7 @@ pa_vtable_entry (int ignore ATTRIBUTE_UNUSED)
{
struct fix *new_fix;
- new_fix = obj_elf_vtable_entry (0);
+ new_fix = obj_elf_get_vtable_entry ();
if (new_fix)
{
@@ -8549,7 +8549,7 @@ pa_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
{
struct fix *new_fix;
- new_fix = obj_elf_vtable_inherit (0);
+ new_fix = obj_elf_get_vtable_inherit ();
if (new_fix)
{
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 32a8b31..552c1b8 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1127,7 +1127,7 @@ const pseudo_typeS md_pseudo_table[] =
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
{"largecomm", handle_large_common, 0},
#else
- {"file", (void (*) (int)) dwarf2_directive_file, 0},
+ {"file", dwarf2_directive_file, 0},
{"loc", dwarf2_directive_loc, 0},
{"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0},
#endif
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index c135131..fca0dea 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -19324,7 +19324,7 @@ s_mips_file (int x ATTRIBUTE_UNUSED)
{
char *filename;
- filename = dwarf2_directive_file (0);
+ filename = dwarf2_directive_filename ();
/* Versions of GCC up to 3.1 start files with a ".file"
directive even for stabs output. Make sure that this
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 3fb5dc1..e7c0b6e 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -751,10 +751,10 @@ get_filenum (const char *filename, unsigned int num)
- Pass .file "source.c" to s_app_file
- Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table
- If an entry is added to the file table, return a pointer to the filename. */
+ If an entry is added to the file table, return a pointer to the filename. */
char *
-dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
+dwarf2_directive_filename (void)
{
offsetT num;
char *filename;
@@ -795,6 +795,15 @@ dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
return filename;
}
+/* Calls dwarf2_directive_filename, but discards its result.
+ Used in pseudo-op tables where the function result is ignored. */
+
+void
+dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
+{
+ (void) dwarf2_directive_filename ();
+}
+
void
dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
{
diff --git a/gas/dwarf2dbg.h b/gas/dwarf2dbg.h
index 06e537b..3c272d6 100644
--- a/gas/dwarf2dbg.h
+++ b/gas/dwarf2dbg.h
@@ -41,8 +41,10 @@ struct dwarf2_line_info
/* Implements the .file FILENO "FILENAME" directive. FILENO can be 0
to indicate that no file number has been assigned. All real file
- number must be >0. */
-extern char *dwarf2_directive_file (int);
+ number must be >0. The second form returns the filename extracted
+ from the input stream. */
+extern void dwarf2_directive_file (int);
+extern char * dwarf2_directive_filename (void);
/* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is
the file number, LINENO the line number and the (optional) COLUMN