Roul Oldenburger <oldenburger.roul@stn-atlas.de> writes:
void retrieve_stabstr(bfd *abfd, asection *section, char *sec_name)
{
printf("Der Sektionsname ist: %s\n", sec_name);
stabstr_size = bfd_section_size (abfd, section);
strtab = (char *) xmalloc (stabstr_size);
printf("stabstr_size ist %d\n", (int) stabstr_size);
if (! bfd_get_section_contents (abfd, section, (PTR) stabs, 0, sec_size))
{
if (sec_name == ".stabstr")
free (strtab);
bfd_errmsg( bfd_get_error() );
return;
}
}
Why are you using sec_size rather than stabstr_size in the call to
bfd_get_section_contents()?
This mistake could easily have been caught by using a debugger, or by
careful reading of the code.
Ian