- /* The kernel sets ld_info to -1, if the process is still using the
- object, and the object is removed. Keep the symbol info for the
- removed object and issue a warning. */
- warning ("%s (fd=%d) has disappeared, keeping its symbols",
- name, ldi->ldinfo_fd);
- continue;
- }
- retry:
- for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
- {
- struct objfile *objfile;
-
- /* First try to find a `vp', which is the same as in ldinfo.
- If not the same, just continue and grep the next `vp'. If same,
- relocate its tstart, tend, dstart, dend values. If no such `vp'
- found, get out of this for loop, add this ldi entry as a new vmap
- (add_vmap) and come back, find its `vp' and so on... */
-
- /* The filenames are not always sufficient to match on. */
-
- if ((name[0] == '/' && !STREQ (name, vp->name))
- || (memb[0] && !STREQ (memb, vp->member)))
- continue;
-
- /* See if we are referring to the same file.
- We have to check objfile->obfd, symfile.c:reread_symbols might
- have updated the obfd after a change. */
- objfile = vp->objfile == NULL ? symfile_objfile : vp->objfile;
- if (objfile == NULL
- || objfile->obfd == NULL
- || bfd_stat (objfile->obfd, &vi) < 0)
- {
- warning ("Unable to stat %s, keeping its symbols", name);
- continue;
- }
-
- if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
- continue;
-
- if (!retried)
- close (ldi->ldinfo_fd);
-
- ++got_one;
-
- /* Found a corresponding VMAP. Remap! */
-
- /* We can assume pointer == CORE_ADDR, this code is native only. */
- vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg;
- vp->tend = vp->tstart + ldi->ldinfo_textsize;
- vp->dstart = (CORE_ADDR) ldi->ldinfo_dataorg;
- vp->dend = vp->dstart + ldi->ldinfo_datasize;
-
- /* The run time loader maps the file header in addition to the text
- section and returns a pointer to the header in ldinfo_textorg.
- Adjust the text start address to point to the real start address
- of the text section. */
- vp->tstart += vp->toffs;
-
- /* The objfile is only NULL for the exec file. */
- if (vp->objfile == NULL)
- got_exec_file = 1;
-
- /* relocate symbol table(s). */
- vmap_symtab (vp);
-
- /* There may be more, so we don't break out of the loop. */