We are using the reloc_nametable zero element as an char array.
So make that element an actual array (we are actually after one
of the next string arrays in the table).
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2020-06-16 Mark Wielard <mark@klomp.org>
+
+ * common-reloc.c (reloc_nametable): Make zero a 1 char array.
+ Initialize it as an array { '\0' }.
+ (reloc_type_name): Access zero as an array.
+
2020-06-10 Mark Wielard <mark@klomp.org>
* aarch64_init.c (aarch64_init): Remove ehlen, return eh.
static const struct EBLHOOK(reloc_nametable)
{
- char zero;
+ char zero[1];
#define RELOC_TYPE(type, uses) \
char name_##type[sizeof R_NAME (type)];
#include RELOC_TYPES
#undef RELOC_TYPE
} EBLHOOK(reloc_nametable) =
{
- '\0',
+ { '\0' },
#define RELOC_TYPE(type, uses) R_NAME (type),
#include RELOC_TYPES
#undef RELOC_TYPE
#endif
if (reloc >= 0 && reloc < nreloc && EBLHOOK(reloc_nameidx)[reloc] != 0)
- return &reloc_namestr[EBLHOOK(reloc_nameidx)[reloc]];
+ return reloc_namestr[EBLHOOK(reloc_nameidx)[reloc]];
return NULL;
}