Improved relocation reading code for the !incore strategy.
This commit is contained in:
parent
24b7ad602a
commit
91aad0b28e
1 changed files with 17 additions and 4 deletions
|
@ -494,9 +494,11 @@ modulsize(head)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct outrelo *walkrelo;
|
static struct outrelo *walkrelo;
|
||||||
|
static unsigned short cnt_relos;
|
||||||
|
static unsigned short index;
|
||||||
|
|
||||||
startrelo(head)
|
startrelo(head)
|
||||||
struct outhead *head;
|
register struct outhead *head;
|
||||||
{
|
{
|
||||||
ind_t reloindex;
|
ind_t reloindex;
|
||||||
|
|
||||||
|
@ -504,18 +506,29 @@ startrelo(head)
|
||||||
reloindex = *(ind_t *)(modulbase + IND_RELO(*head));
|
reloindex = *(ind_t *)(modulbase + IND_RELO(*head));
|
||||||
walkrelo = (struct outrelo *)address(ALLORELO, reloindex);
|
walkrelo = (struct outrelo *)address(ALLORELO, reloindex);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
index = 20;
|
||||||
|
rd_rew_relos(head);
|
||||||
|
cnt_relos = head->oh_nrelos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct outrelo *
|
struct outrelo *
|
||||||
nextrelo()
|
nextrelo()
|
||||||
{
|
{
|
||||||
static struct outrelo relobuf;
|
static struct outrelo relobuf[20];
|
||||||
|
|
||||||
if (incore)
|
if (incore)
|
||||||
return walkrelo++;
|
return walkrelo++;
|
||||||
|
|
||||||
rd_relo(&relobuf, 1);
|
if (index == 20) {
|
||||||
return &relobuf;
|
int i = cnt_relos >= 20 ? 20 : cnt_relos;
|
||||||
|
|
||||||
|
cnt_relos -= i;
|
||||||
|
rd_relo(relobuf, i);
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
return &relobuf[index++];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
Loading…
Add table
Reference in a new issue