]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Silence warnings due to plugin API change
authorAlan Modra <amodra@gmail.com>
Wed, 25 Mar 2020 13:52:33 +0000 (06:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Mar 2020 13:52:33 +0000 (06:52 -0700)
* 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)

ld/ChangeLog
ld/testplug.c
ld/testplug2.c
ld/testplug3.c
ld/testplug4.c

index 58ee70b1b6bb8d5d9fe504e1c4fba9b22bf980ab..ad6b68137dbdbea5706935cd5146f0d1c91b9017 100644 (file)
@@ -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
index 9dd0b91e45bec056ea530cfc00e04416469d34e1..c126f0360736b8a13e12bd1c4026c42a167c3f45 100644 (file)
@@ -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)
index ecd9a44d7310d06b3fbb6b158cb8cc373ee0a3c7..27553d07813b8e291caed595399b155c0e6ba94a 100644 (file)
@@ -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)
index 05fdca02e25c7a6250091bfe1328068cbfaef5bd..928f4d68426a55842a81f706950827bd56d7dbe2 100644 (file)
@@ -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)
index adaedf47c3fa131f8c9f30a5457f020bf2b75a4a..ca899b11da1da0f8bc8e06b5a07563e04f7640ba 100644 (file)
@@ -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)