* xcofflink.c (xcoff_link_add_symbols): Handle csects in the
absolute section.
This commit is contained in:
parent
df72d2a576
commit
697a8fe872
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Oct 28 01:51:02 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* xcofflink.c (xcoff_link_add_symbols): Handle csects in the
|
||||||
|
absolute section.
|
||||||
|
|
||||||
Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com>
|
Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
* xcofflink.c: More improvements, mostly to fix handling of
|
* xcofflink.c: More improvements, mostly to fix handling of
|
||||||
|
|
|
@ -1319,9 +1319,10 @@ xcoff_link_add_symbols (abfd, info)
|
||||||
enclosing = coff_section_from_bfd_index (abfd, sym.n_scnum);
|
enclosing = coff_section_from_bfd_index (abfd, sym.n_scnum);
|
||||||
if (enclosing == NULL)
|
if (enclosing == NULL)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
if ((bfd_vma) sym.n_value < enclosing->vma
|
if (! bfd_is_abs_section (enclosing)
|
||||||
|| ((bfd_vma) sym.n_value + aux.x_csect.x_scnlen.l
|
&& ((bfd_vma) sym.n_value < enclosing->vma
|
||||||
> enclosing->vma + enclosing->_raw_size))
|
|| ((bfd_vma) sym.n_value + aux.x_csect.x_scnlen.l
|
||||||
|
> enclosing->vma + enclosing->_raw_size)))
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
("%s: csect `%s' not in enclosing section",
|
("%s: csect `%s' not in enclosing section",
|
||||||
|
@ -1362,32 +1363,36 @@ xcoff_link_add_symbols (abfd, info)
|
||||||
could do a binary search here. FIXME. (XCOFF
|
could do a binary search here. FIXME. (XCOFF
|
||||||
unfortunately does not require that symbols be sorted
|
unfortunately does not require that symbols be sorted
|
||||||
by address, or this would be a simple merge). */
|
by address, or this would be a simple merge). */
|
||||||
rel = reloc_info[enclosing->target_index].relocs;
|
if (enclosing->owner == abfd)
|
||||||
rel_csect = reloc_info[enclosing->target_index].csects;
|
|
||||||
for (relindx = 0;
|
|
||||||
relindx < enclosing->reloc_count;
|
|
||||||
relindx++, rel++, rel_csect++)
|
|
||||||
{
|
{
|
||||||
if (*rel_csect == NULL
|
rel = reloc_info[enclosing->target_index].relocs;
|
||||||
&& rel->r_vaddr >= csect->vma
|
rel_csect = reloc_info[enclosing->target_index].csects;
|
||||||
&& rel->r_vaddr < csect->vma + csect->_raw_size)
|
for (relindx = 0;
|
||||||
|
relindx < enclosing->reloc_count;
|
||||||
|
relindx++, rel++, rel_csect++)
|
||||||
{
|
{
|
||||||
csect->rel_filepos = (enclosing->rel_filepos
|
if (*rel_csect == NULL
|
||||||
+ relindx * bfd_coff_relsz (abfd));
|
&& rel->r_vaddr >= csect->vma
|
||||||
break;
|
&& rel->r_vaddr < csect->vma + csect->_raw_size)
|
||||||
|
{
|
||||||
|
csect->rel_filepos = (enclosing->rel_filepos
|
||||||
|
+ (relindx
|
||||||
|
* bfd_coff_relsz (abfd)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (relindx < enclosing->reloc_count
|
||||||
|
&& *rel_csect == NULL
|
||||||
|
&& rel->r_vaddr >= csect->vma
|
||||||
|
&& rel->r_vaddr < csect->vma + csect->_raw_size)
|
||||||
|
{
|
||||||
|
*rel_csect = csect;
|
||||||
|
csect->flags |= SEC_RELOC;
|
||||||
|
++csect->reloc_count;
|
||||||
|
++relindx;
|
||||||
|
++rel;
|
||||||
|
++rel_csect;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
while (relindx < enclosing->reloc_count
|
|
||||||
&& *rel_csect == NULL
|
|
||||||
&& rel->r_vaddr >= csect->vma
|
|
||||||
&& rel->r_vaddr < csect->vma + csect->_raw_size)
|
|
||||||
{
|
|
||||||
*rel_csect = csect;
|
|
||||||
csect->flags |= SEC_RELOC;
|
|
||||||
++csect->reloc_count;
|
|
||||||
++relindx;
|
|
||||||
++rel;
|
|
||||||
++rel_csect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* There are a number of other fields and section flags
|
/* There are a number of other fields and section flags
|
||||||
|
|
Loading…
Reference in New Issue