aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-03-25 06:52:33 -0700
committerAndreas K. Hüttel <dilfridge@gentoo.org>2020-05-08 20:45:24 +0300
commit1494a711a8c6eac660306885b14b4a2761179b3e (patch)
treea106eef92efebf3f89466c7e8da981c31ea3c0e1
parentInclude: Sync lto-symtab.h and plugin-api.h with GCC (diff)
downloadbinutils-gdb-1494a711a8c6eac660306885b14b4a2761179b3e.tar.gz
binutils-gdb-1494a711a8c6eac660306885b14b4a2761179b3e.tar.bz2
binutils-gdb-1494a711a8c6eac660306885b14b4a2761179b3e.zip
Silence warnings due to plugin API change
* testplug.c (parse_symdefstr): Use %hhi to read sym->def, and clear new fields. * testplug2.c (parse_symdefstr): Likewise. * testplug3.c (parse_symdefstr): Likewise. * testplug4.c (parse_symdefstr): Likewise. (cherry picked from commit c02d66610b3b79f6fb5052e8890969bc7185b7be) (cherry picked from commit aaa1e160040ce2d8f382f9327cc7aea078373f3d)
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testplug.c5
-rw-r--r--ld/testplug2.c5
-rw-r--r--ld/testplug3.c5
-rw-r--r--ld/testplug4.c5
5 files changed, 24 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 58ee70b1b6..ad6b68137d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2020-03-25 Alan Modra <amodra@gmail.com>
+
+ * testplug.c (parse_symdefstr): Use %hhi to read sym->def, and
+ clear new fields.
+ * testplug2.c (parse_symdefstr): Likewise.
+ * testplug3.c (parse_symdefstr): Likewise.
+ * testplug4.c (parse_symdefstr): Likewise.
+
2020-02-28 Alan Modra <amodra@gmail.com>
Apply from master
diff --git a/ld/testplug.c b/ld/testplug.c
index 9dd0b91e45..c126f03607 100644
--- a/ld/testplug.c
+++ b/ld/testplug.c
@@ -239,12 +239,15 @@ parse_symdefstr (const char *str, struct ld_plugin_symbol *sym)
/* Finally we'll use sscanf to parse the numeric fields, then
we'll split out the strings which we need to allocate separate
storage for anyway so that we can add nul termination. */
- n = sscanf (colon2 + 1, "%i:%i:%lli", &sym->def, &sym->visibility, &size);
+ n = sscanf (colon2 + 1, "%hhi:%i:%lli", &sym->def, &sym->visibility, &size);
if (n != 3)
return LDPS_ERR;
/* Parsed successfully, so allocate strings and fill out fields. */
sym->size = size;
+ sym->unused = 0;
+ sym->section_kind = 0;
+ sym->symbol_type = 0;
sym->resolution = LDPR_UNKNOWN;
sym->name = malloc (colon1 - str + 1);
if (!sym->name)
diff --git a/ld/testplug2.c b/ld/testplug2.c
index ecd9a44d73..27553d0781 100644
--- a/ld/testplug2.c
+++ b/ld/testplug2.c
@@ -218,12 +218,15 @@ parse_symdefstr (const char *str, struct ld_plugin_symbol *sym)
/* Finally we'll use sscanf to parse the numeric fields, then
we'll split out the strings which we need to allocate separate
storage for anyway so that we can add nul termination. */
- n = sscanf (colon2 + 1, "%i:%i:%lli", &sym->def, &sym->visibility, &size);
+ n = sscanf (colon2 + 1, "%hhi:%i:%lli", &sym->def, &sym->visibility, &size);
if (n != 3)
return LDPS_ERR;
/* Parsed successfully, so allocate strings and fill out fields. */
sym->size = size;
+ sym->unused = 0;
+ sym->section_kind = 0;
+ sym->symbol_type = 0;
sym->resolution = LDPR_UNKNOWN;
sym->name = malloc (colon1 - str + 1);
if (!sym->name)
diff --git a/ld/testplug3.c b/ld/testplug3.c
index 05fdca02e2..928f4d6842 100644
--- a/ld/testplug3.c
+++ b/ld/testplug3.c
@@ -217,12 +217,15 @@ parse_symdefstr (const char *str, struct ld_plugin_symbol *sym)
/* Finally we'll use sscanf to parse the numeric fields, then
we'll split out the strings which we need to allocate separate
storage for anyway so that we can add nul termination. */
- n = sscanf (colon2 + 1, "%i:%i:%lli", &sym->def, &sym->visibility, &size);
+ n = sscanf (colon2 + 1, "%hhi:%i:%lli", &sym->def, &sym->visibility, &size);
if (n != 3)
return LDPS_ERR;
/* Parsed successfully, so allocate strings and fill out fields. */
sym->size = size;
+ sym->unused = 0;
+ sym->section_kind = 0;
+ sym->symbol_type = 0;
sym->resolution = LDPR_UNKNOWN;
sym->name = malloc (colon1 - str + 1);
if (!sym->name)
diff --git a/ld/testplug4.c b/ld/testplug4.c
index adaedf47c3..ca899b11da 100644
--- a/ld/testplug4.c
+++ b/ld/testplug4.c
@@ -218,12 +218,15 @@ parse_symdefstr (const char *str, struct ld_plugin_symbol *sym)
/* Finally we'll use sscanf to parse the numeric fields, then
we'll split out the strings which we need to allocate separate
storage for anyway so that we can add nul termination. */
- n = sscanf (colon2 + 1, "%i:%i:%lli", &sym->def, &sym->visibility, &size);
+ n = sscanf (colon2 + 1, "%hhi:%i:%lli", &sym->def, &sym->visibility, &size);
if (n != 3)
return LDPS_ERR;
/* Parsed successfully, so allocate strings and fill out fields. */
sym->size = size;
+ sym->unused = 0;
+ sym->section_kind = 0;
+ sym->symbol_type = 0;
sym->resolution = LDPR_UNKNOWN;
sym->name = malloc (colon1 - str + 1);
if (!sym->name)