aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
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