mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
objcopy add-symbol uninitialised struct
* objcopy.c: Formatting, whitespace throughout. (copy_main): Init newsym->othersym. (parse_symflags): Make len a size_t. Adjust uses.
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
2016-05-31 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* objcopy.c: Formatting, whitespace throughout.
|
||||
(copy_main): Init newsym->othersym.
|
||||
(parse_symflags): Make len a size_t. Adjust uses.
|
||||
|
||||
2016-05-25 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR binutils/14625
|
||||
|
@ -757,7 +757,7 @@ parse_symflags (const char *s, char **other)
|
||||
{
|
||||
flagword ret;
|
||||
const char *snext;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
ret = BSF_NO_FLAGS;
|
||||
|
||||
@ -773,11 +773,13 @@ parse_symflags (const char *s, char **other)
|
||||
}
|
||||
|
||||
#define PARSE_FLAG(fname, fval) \
|
||||
else if (len == (int) sizeof fname - 1 && strncasecmp (fname, s, len) == 0) \
|
||||
else if (len == sizeof fname - 1 \
|
||||
&& strncasecmp (fname, s, len) == 0) \
|
||||
ret |= fval
|
||||
|
||||
#define PARSE_OTHER(fname, fval) \
|
||||
else if (len >= (int) sizeof fname && strncasecmp (fname, s, sizeof fname - 1) == 0) \
|
||||
else if (len >= sizeof fname \
|
||||
&& strncasecmp (fname, s, sizeof fname - 1) == 0) \
|
||||
fval = xstrndup (s + sizeof fname - 1, len - sizeof fname + 1)
|
||||
|
||||
if (0) ;
|
||||
@ -4127,6 +4129,7 @@ copy_main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
t = strchr (t + 1, ',');
|
||||
newsym->othersym = NULL;
|
||||
if (t)
|
||||
newsym->flags = parse_symflags (t+1, &newsym->othersym);
|
||||
else
|
||||
|
Reference in New Issue
Block a user