In objfile_relocate(), don't assume that offsets associated with one
of SECT_OFF_TEXT, SECT_OFF_DATA, or SECT_OFF_BSS will be adequate for relocating all of the sections in an objfile.
This commit is contained in:
parent
dcd619bedd
commit
78f0949be7
2 changed files with 11 additions and 19 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2000-09-12 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
|
* objfiles.c (objfile_relocate): Don't assume that offsets
|
||||||
|
associated with one of SECT_OFF_TEXT, SECT_OFF_DATA, or
|
||||||
|
SECT_OFF_BSS will be adequate for relocating all of the
|
||||||
|
sections in an objfile.
|
||||||
|
|
||||||
2000-09-12 Fernando Nasser <fnasser@cygnus.com>
|
2000-09-12 Fernando Nasser <fnasser@cygnus.com>
|
||||||
|
|
||||||
* remote-rdi.c (arm_rdi_open): Fix typo in error message.
|
* remote-rdi.c (arm_rdi_open): Fix typo in error message.
|
||||||
|
|
|
@ -650,25 +650,10 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
|
||||||
|
|
||||||
ALL_OBJFILE_OSECTIONS (objfile, s)
|
ALL_OBJFILE_OSECTIONS (objfile, s)
|
||||||
{
|
{
|
||||||
flagword flags;
|
int idx = s->the_bfd_section->index;
|
||||||
|
|
||||||
flags = bfd_get_section_flags (abfd, s->the_bfd_section);
|
s->addr += ANOFFSET (delta, idx);
|
||||||
|
s->endaddr += ANOFFSET (delta, idx);
|
||||||
if (flags & SEC_CODE)
|
|
||||||
{
|
|
||||||
s->addr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
|
|
||||||
s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
|
|
||||||
}
|
|
||||||
else if (flags & (SEC_DATA | SEC_LOAD))
|
|
||||||
{
|
|
||||||
s->addr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
|
|
||||||
s->endaddr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
|
|
||||||
}
|
|
||||||
else if (flags & SEC_ALLOC)
|
|
||||||
{
|
|
||||||
s->addr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
|
|
||||||
s->endaddr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue