mirror of
https://frontier.innolan.net/github/amigaos-binutils.git
synced 2025-11-21 02:11:05 +00:00
fix .stab/.stabstr hunks, drop if not a debug version otherwise make these the last hunks
This commit is contained in:
@ -1594,7 +1594,7 @@ amiga_write_object_contents (abfd)
|
|||||||
{
|
{
|
||||||
long datadata_relocs = 0, bss_size = 0, idx;
|
long datadata_relocs = 0, bss_size = 0, idx;
|
||||||
int *index_map, max_hunk = -1;
|
int *index_map, max_hunk = -1;
|
||||||
sec_ptr data_sec, p;
|
sec_ptr data_sec, p, q;
|
||||||
unsigned long i, n[5];
|
unsigned long i, n[5];
|
||||||
|
|
||||||
/* Distinguish UNITS, LOAD Files
|
/* Distinguish UNITS, LOAD Files
|
||||||
@ -1603,6 +1603,56 @@ amiga_write_object_contents (abfd)
|
|||||||
|
|
||||||
abfd->output_has_begun = TRUE; /* Output has begun */
|
abfd->output_has_begun = TRUE; /* Output has begun */
|
||||||
|
|
||||||
|
if (AMIGA_DATA(abfd)->IsLoadFile)
|
||||||
|
{
|
||||||
|
// shuffle .stab and .stabstr to end
|
||||||
|
for (q = abfd->sections, p = q->next; p != NULL; q = p, p = p->next)
|
||||||
|
{
|
||||||
|
if (0 == strcmp (p->name, ".stab"))
|
||||||
|
{
|
||||||
|
if (p->next)
|
||||||
|
{
|
||||||
|
q->next = p->next;
|
||||||
|
if (write_debug_hunk)
|
||||||
|
{
|
||||||
|
q = p->next;
|
||||||
|
while (q->next)
|
||||||
|
q = q->next;
|
||||||
|
q->next = p;
|
||||||
|
p->next = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
q->next = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (q = abfd->sections, p = q->next; p != NULL; q = p, p = p->next)
|
||||||
|
{
|
||||||
|
if (0 == strcmp (p->name, ".stabstr"))
|
||||||
|
{
|
||||||
|
if (p->next)
|
||||||
|
{
|
||||||
|
q->next = p->next;
|
||||||
|
if (write_debug_hunk)
|
||||||
|
{
|
||||||
|
q = p->next;
|
||||||
|
while (q->next)
|
||||||
|
q = q->next;
|
||||||
|
q->next = p;
|
||||||
|
p->next = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
q->next = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int n = 0;
|
||||||
|
for (p = abfd->sections; p != NULL; p = p->next)
|
||||||
|
p->index = n++;
|
||||||
|
}
|
||||||
|
|
||||||
index_map = bfd_alloc (abfd, abfd->section_count * sizeof(int));
|
index_map = bfd_alloc (abfd, abfd->section_count * sizeof(int));
|
||||||
if (!index_map)
|
if (!index_map)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user