mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-10 18:29:39 +00:00
hack gdb to relocate sections properly
This commit is contained in:
parent
4912a44e49
commit
ba04456f23
|
@ -285,6 +285,12 @@ init_objfile_sect_indices (struct objfile *objfile)
|
|||
sect = bfd_get_section_by_name (objfile->obfd, ".text");
|
||||
if (sect)
|
||||
objfile->sect_index_text = sect->index;
|
||||
else
|
||||
{
|
||||
sect = bfd_get_section_by_name (objfile->obfd, ".code2");
|
||||
if (sect)
|
||||
objfile->sect_index_text = sect->index;
|
||||
}
|
||||
|
||||
sect = bfd_get_section_by_name (objfile->obfd, ".data");
|
||||
if (sect)
|
||||
|
@ -705,6 +711,21 @@ default_symfile_offsets (struct objfile *objfile,
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bfd *abfd = objfile->obfd;
|
||||
section_offsets &offsets = objfile->section_offsets;
|
||||
asection *cur_sec;
|
||||
|
||||
for (cur_sec = abfd->sections; cur_sec != NULL;
|
||||
cur_sec = cur_sec->next)
|
||||
{
|
||||
if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
|
||||
continue;
|
||||
uint32_t vma = cur_sec->vma;
|
||||
offsets[cur_sec->index] -= vma;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remember the bfd indexes for the .text, .data, .bss and
|
||||
.rodata sections. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user