asection **secp;
arelent *rel;
{
- bfd_byte temp[4];
bfd_vma val, addend;
- const char *name;
int index;
unsigned int type;
struct nlm32_sparc_reloc_ext tmp_reloc;
bfd_size_type rcount; /* number of relocs */
bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* temporary 32-bit value */
unsigned char symlength; /* length of symbol name */
+ char *name;
/*
* First, read in the number of relocation
!= sizeof (symlength))
return false;
sym -> symbol.the_bfd = abfd;
- sym -> symbol.name = bfd_alloc (abfd, symlength + 1);
- if (!sym -> symbol.name)
+ name = bfd_alloc (abfd, symlength + 1);
+ if (name == NULL)
{
bfd_set_error (bfd_error_no_memory);
return false;
* Then read in the symbol
*/
- if (bfd_read ((PTR) sym -> symbol.name, symlength, 1, abfd)
- != symlength)
+ if (bfd_read (name, symlength, 1, abfd) != symlength)
return false;
+ name[symlength] = '\0';
+ sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = &bfd_und_section;