X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Ftestplug4.c;h=6e41f81298b04e6e6ef3ea8e30fb852baa77603b;hb=f5fb419ff3bc723f974b0538dce1c51a81c33484;hp=fe7665aea3fedc2fd03ac4d50d82e26ce0523bd7;hpb=3355cb3b643bd50aafae768e7cf990d4bec40fe1;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/testplug4.c b/ld/testplug4.c index fe7665aea3..6e41f81298 100644 --- a/ld/testplug4.c +++ b/ld/testplug4.c @@ -1,6 +1,6 @@ /* Test plugin for the GNU linker. Check non-object IR file as well as get_input_file, get_view, release_input_file and get_symbols interfaces. - Copyright (C) 2016 Free Software Foundation, Inc. + Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -21,6 +21,7 @@ #include "sysdep.h" #include "bfd.h" +#if BFD_SUPPORTS_PLUGINS #include "plugin-api.h" #include "filenames.h" /* For ARRAY_SIZE macro only - we don't link the library itself. */ @@ -218,12 +219,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) @@ -608,7 +612,7 @@ onall_symbols_read (void) #define EXPECTED_VIEW "/* The first line of this file must match the expectation of" #define EXPECTED_VIEW_LENGTH (sizeof (EXPECTED_VIEW) - 1) if (file.filesize != SIZE_OF_PR20070B_C - || SIZE_OF_PR20070B_C < sizeof EXPECTED_VIEW_LENGTH + || SIZE_OF_PR20070B_C < EXPECTED_VIEW_LENGTH || memcmp (view, EXPECTED_VIEW, EXPECTED_VIEW_LENGTH) != 0) { char result[EXPECTED_VIEW_LENGTH + 1]; @@ -672,3 +676,4 @@ oncleanup (void) fflush (NULL); return cleanup_ret; } +#endif /* BFD_SUPPORTS_PLUGINS */