- unsigned int length;
- cache_ptr->symbol.the_bfd = abfd;
- cache_ptr->symbol.value = GET_SWORD(abfd, sym_pointer->e_value);
- cache_ptr->desc = bfd_get_16(abfd, sym_pointer->e_almod);
- cache_ptr->type = bfd_get_8(abfd, sym_pointer->e_type);
- cache_ptr->symbol.udata = 0;
- length = bfd_get_8(abfd, sym_pointer->e_length);
- cache_ptr->other = length; /* other not used, save length here */
-
- cache_save = *cache_ptr;
- convert_sym_type(sym_pointer, cache_ptr, abfd);
- if (!translate_from_native_sym_flags (sym_pointer, cache_ptr, abfd))
- return false;
-
- /********************************************************/
- /* for hpux, the 'lenght' value indicates the length of */
- /* the symbol name which follows the nlist entry. */
- /********************************************************/
- if (length)
- {
- /**************************************************************/
- /* the hp string is not null terminated so we create a new one*/
- /* by copying the string to overlap the just vacated nlist */
- /* structure before it in memory. */
- /**************************************************************/
- cache_ptr->symbol.name = strings;
- memcpy(strings, sym_pointer+1, length);
- strings[length] = '\0';
- strings += length + 1;
- }
- else
- cache_ptr->symbol.name = (char *)NULL;
-
- /**********************************************************/
- /* this is a bit of a kludge, but a secondary hp symbol */
- /* gets translated into a gnu indirect symbol. When this */
- /* happens, we need to create a "dummy" record to which */
- /* we can point the indirect symbol to. */
- /**********************************************************/
- if ((cache_ptr->type | N_EXT) == (N_INDR | N_EXT))
- {
- aout_symbol_type *cache_ptr2 = cached + num_syms+num_secondary;
-
- num_secondary++;
-
- /* aoutx.h assumes the "next" value is the indirect sym */
- /* since we don't want to disturb the order by inserting */
- /* a new symbol, we tack on the created secondary syms */
- /* at the end. */
- cache_ptr->symbol.value = (bfd_vma)(cache_ptr2);
- *cache_ptr2 = cache_save;
- cache_ptr2->symbol.name = strings;
- memcpy(strings, cache_ptr->symbol.name, length);
- strcpy(strings+length,":secondry"); /* 9 max chars + null */
- strings += length+10;
- cache_ptr2->type &= ~HP_SECONDARY_SYMBOL; /* clear secondary */
- convert_sym_type(sym_pointer, cache_ptr2, abfd);
- if (!translate_from_native_sym_flags (sym_pointer, cache_ptr2,
- abfd))
- return false;
- }
-
- /* skip over the embedded symbol. */
- sym_pointer = (struct external_nlist *) (((char *)sym_pointer) +
- length);