struct symbol_dictionary_record *buf, *bufp, *endbufp;
char *symname;
CONST int symsize = sizeof (struct symbol_dictionary_record);
- CORE_ADDR text_offset;
+ CORE_ADDR text_offset, data_offset;
- /* FIXME. Data stuff needs dynamic relocation too! */
text_offset = ANOFFSET (section_offsets, 0);
+ data_offset = ANOFFSET (section_offsets, 1);
number_of_symbols = bfd_get_symcount (abfd);
case ST_DATA:
symname = bufp->name.n_strx + stringtab;
+ bufp->symbol_value += data_offset;
ms_type = mst_data;
break;
default:
the nasty habit of placing section symbols from the literal
subspaces in the middle of the program's text. Filter
those out as best we can. Check for first and last character
- being '$'. */
+ being '$'.
+
+ And finally, the newer HP compilers emit crud like $PIC_foo$N
+ in some circumstance (PIC code I guess). It's also claimed
+ that they emit D$ symbols too. What stupidity. */
if ((symname[0] == 'L' && symname[1] == '$')
- || (symname[0] == '$' && symname[strlen(symname) - 1] == '$'))
+ || (symname[0] == '$' && symname[strlen(symname) - 1] == '$')
+ || (symname[0] == 'D' && symname[1] == '$')
+ || (strncmp (symname, "$PIC", 4) == 0))
continue;
break;
case ST_DATA:
symname = bufp->name.n_strx + stringtab;
+ bufp->symbol_value += data_offset;
ms_type = mst_file_data;
goto check_strange_names;
sizeof (struct section_offsets)
+ sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
- for (i = 0; i < SECT_OFF_MAX; i++)
- ANOFFSET (section_offsets, i) = addr;
+ /* First see if we're a shared library. If so, get the section
+ offsets from the library, else get them from addr. */
+ if (!som_solib_section_offsets (objfile, section_offsets))
+ {
+ for (i = 0; i < SECT_OFF_MAX; i++)
+ ANOFFSET (section_offsets, i) = addr;
+ }
return section_offsets;
}