Lines Matching defs:input

138    its own newly-added input files and libs to claim.  */
483 /* Add symbols from a plugin-claimed input file. */
488 plugin_input_file_t *input = handle;
489 bfd *abfd = input->abfd;
509 /* Get the input file information with an open (possibly re-opened)
514 const plugin_input_file_t *input = handle;
518 file->name = input->name;
519 file->offset = input->offset;
520 file->filesize = input->filesize;
526 /* Get view of the input file. */
530 plugin_input_file_t *input = (plugin_input_file_t *) handle;
532 size_t size = input->filesize;
533 off_t offset = input->offset;
541 if ((off_t) size != input->filesize)
542 einfo (_("%P%F: unsupported input file size: %s (%ld bytes)\n"),
543 input->name, (long) input->filesize);
546 if (input->view_buffer.addr != NULL
547 && input->view_buffer.filesize == size
548 && input->view_buffer.offset == offset)
550 *viewp = input->view_buffer.addr;
554 input->view_buffer.filesize = size;
555 input->view_buffer.offset = offset;
563 buffer = mmap (NULL, size, PROT_READ, MAP_PRIVATE, input->fd, offset);
566 input->use_mmap = TRUE;
576 input->use_mmap = FALSE;
578 if (lseek (input->fd, offset, SEEK_SET) < 0)
581 buffer = bfd_alloc (input->abfd, size);
588 ssize_t got = read (input->fd, p, size);
602 input->view_buffer.addr = buffer;
608 /* Release the input file. */
612 plugin_input_file_t *input = (plugin_input_file_t *) handle;
614 if (input->fd != -1)
616 close (input->fd);
617 input->fd = -1;
667 /* Get the symbol resolution info for a plugin-claimed input file. */
672 const plugin_input_file_t *input = handle;
673 const bfd *abfd = (const bfd *) input->abfd;
804 /* Add a new (real) input file generated by a plugin. */
1091 plugin_input_file_t *input;
1111 input = bfd_alloc (abfd, sizeof (*input));
1112 if (input == NULL)
1113 einfo (_("%P%F: plugin failed to allocate memory for input: %s\n"),
1126 file.handle = input;
1133 input->abfd = abfd;
1134 input->view_buffer.addr = NULL;
1135 input->view_buffer.filesize = 0;
1136 input->view_buffer.offset = 0;
1137 input->fd = file.fd;
1138 input->use_mmap = FALSE;
1139 input->offset = file.offset;
1140 input->filesize = file.filesize;
1141 input->name = plugin_strdup (abfd, ibfd->filename);
1149 if (input->fd != -1 && !bfd_plugin_target_p (ibfd->xvec))
1159 close (input->fd);
1160 input->fd = -1;
1173 if (input->use_mmap)
1176 char *addr = input->view_buffer.addr;
1177 off_t size = input->view_buffer.filesize;
1179 off_t bias = input->view_buffer.offset % plugin_pagesize;