+2014-08-07 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): Ensure local symbols are
+ zero terminated.
+
2014-08-07 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra <amodra@gmail.com>
{
/* It is a file local symbol. */
int *local_toc_table;
- const char *name;
+ char name[SYMNMLEN + 1];
sym = syms + symndx;
- name = sym->_n._n_name;
+ strncpy (name, sym->_n._n_name, SYMNMLEN);
+ name[SYMNMLEN] = '\0';
local_toc_table = obj_coff_local_toc_table(input_bfd);
our_toc_offset = local_toc_table[symndx];
case IMAGE_REL_PPC_ABSOLUTE:
{
const char *my_name;
+ char buf[SYMNMLEN + 1];
if (h == 0)
- my_name = (syms+symndx)->_n._n_name;
+ {
+ strncpy (buf, (syms+symndx)->_n._n_name, SYMNMLEN);
+ buf[SYMNMLEN] = '\0';
+ my_name = buf;
+ }
else
my_name = h->root.root.root.string;
}
if (h == 0)
- {
- /* It is a file local symbol. */
- sym = syms + symndx;
- name = sym->_n._n_name;
- }
+ /* It is a file local symbol. */
+ sym = syms + symndx;
else
{
char *target = 0;