Lines Matching refs:FILE
2 This file is part of Red Hat elfutils.
118 /* Check whether file associated with FD is a DSO. */
132 /* Print the complete name of a file, including the archive it is
135 print_file_name (FILE *s, struct usedfiles *fileinfo, int first_level,
172 struct usedfiles *file = scninfo->fileinfo;
174 /* If this symbol is not undefined in this file it cannot come from
176 if (symidx < file->nlocalsymbols)
179 struct symbol *sym = file->symref[symidx];
186 parameters are parsed but before any file is searched for. */
246 /* Construct the file name. */
343 /* Find a file along the path described in the state. */
360 /* Create the file name. */
371 /* We have to create the actual file name. We prepend "lib"
410 /* We found the file. This also means the directory
415 /* Check whether we have this file already loaded. */
431 /* The file does not exist. Maybe the whole directory doesn't.
447 /* The directory does not exist or the named file is no
477 /* We found the file. */
535 size_t oldgrpid = oldp->file->scninfo[oldp->scndx].grpid;
541 assert (SCNINFO_SHDR (oldp->file->scninfo[oldgrpid].shdr).sh_type
545 || ! oldp->file->scninfo[oldgrpid].comdat_group)
549 oldp->file->scninfo[oldgrpid].symbols->name) != 0)
578 oldp->file->rfname,
588 oldp->name, (uint64_t) oldp->size, oldp->file->rfname,
598 bool old_in_dso = FILEINFO_EHDR (oldp->file->ehdr).e_type == ET_DYN;
609 redefinition of a symbol definition in an object file
674 /* XXX Print source file and line number. */
684 oldfile = oldp->file;
698 /* XXX Print source file and line number. */
708 /* We use the definition from a normal relocatable file over the
757 oldp->file = fileinfo;
839 file. */
921 /* Make sure the section header has been read from the file. */
1156 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1171 /* Make the file structure available. */
1298 symbol->file = fileinfo;
1346 /* According to the gABI it is a fatal error if the file contains
1356 generated from scratch for the new output file. We also
1358 not used in the resulting object file. */
1390 hash table. In theory there can be a file without any symbol
1394 /* In case this file contains merge-able sections we have to
1413 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1422 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1442 newp->file = fileinfo;
1481 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1490 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1554 newp->file = fileinfo;
1648 /* This file is used. */
1692 /* Create a record for the new file. */
1699 /* Set as-needed flag from the file, not the command line. */
1702 /* Read the file and everything else which comes up, including
1721 /* Handle opening of the given file with ELF descriptor. */
1729 gettext ("cannot get descriptor for ELF file (%s:%d): %s\n"),
1736 /* We don't have to look at this file again. */
1741 /* Create a stream from the file handle we know. */
1749 /* Get the content of the file. */
1753 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
1758 /* The content of the file is available in memory. Read the
1770 /* Parse the file. If it is a linker script no problems will be
1781 /* We won't need the file descriptor again. */
1792 /* This is no ELF file. */
1817 /* Store the file info. */
1820 /* The file is ready for action. */
1853 /* This shows that this file is contained in an archive. */
1860 /* Proces the file, add all the symbols etc. */
1945 a file now. */
1954 /* This shows that this file is contained in an archive. */
1961 /* Now read the file and add all the symbols. */
2005 fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
2020 gettext ("file of type %s cannot be linked in\n"),
2028 /* Make sure the file type matches the backend. */
2033 %s: input file incompatible with ELF machine type %s\n"),
2065 /* If the file is a DT_NEEDED dependency then the type is
2074 cannot use DSO '%s' when generating relocatable object file"),
2113 // XXX Check that there not already a file with the
2130 /* Construct the file name if the DSO has no SONAME and the
2131 file name comes from a -lXX parameter on the comment
2158 error (0, 0, gettext ("input file '%s' ignored"), fileinfo->fname);
2188 /* Process a given file. The first parameter is a file descriptor for
2189 the file which can be -1 to indicate the file has not yet been
2190 found. The second parameter describes the file to be opened, the
2199 /* By default we go to the next file in the list. */
2209 /* If the file isn't open yet, open it now. */
2216 /* Find the file ourselves. */
2231 /* We found the file. Now test whether it is a file type we can
2235 position in the search path again to look for another file if
2245 /* Now that we have opened the file start processing it. */
2249 /* Determine which file to look at next. */
2270 the whole file but only some data structures. */
2288 Determine which file we would go back to and see whether it
2373 s->name, s->file->fname);
2394 /* Close the given file. */
2401 /* If we have opened the file descriptor close it. But we might
2406 /* We allocated the resolved file name. */
2439 present in the input file. */
2446 /* When requested, every output file will have a build ID section. */
2453 should be at the very beginning of the file together with the
2455 at. We put it as the first section in the file.
2531 srunp->file->used = true;
2533 if (srunp->file->verdefdata != NULL)
2542 if (xelf_getversym_copy (srunp->file->versymdata,
2555 versions in the output file. */
2556 if (! srunp->file->verdefused[versym])
2558 srunp->file->verdefused[versym] = 1;
2560 if (++srunp->file->nverdefused == 1)
2561 /* Count the file if it is using versioning. */
2618 /* When creating a relocatable file or when we are not stripping the
2619 output file we create a symbol table. */
2651 /* Create the output file. The file name is given or "a.out". We
2657 /* We do not create the new file right away with the final name.
2658 This would destroy an existing file with this name before a
2659 replacement is finalized. We create instead a temporary file in
2677 file will have these permissions anyhow. Any intruder could
2678 change the file later if it would be possible now. */
2687 error (EXIT_FAILURE, errno, gettext ("cannot create output file"));
2691 /* Make sure we remove the temporary file in case something goes
2695 /* Create the ELF file data for the output file. */
2702 gettext ("cannot create ELF descriptor for output file: %s"),
2709 gettext ("could not create ELF header for output file: %s"),
2770 XElf_Off symalign = MAX (SCNINFO_SHDR (runp->file->scninfo[runp->scndx].shdr).sh_addralign, 1);
2858 /* Now we have to match the file names of the input files. Some of
2866 /* Base of the file name the section comes from. */
2878 /* This file does not match the file name masks. */
2888 file with the correct section name etc. */
2903 /* Create a new section for the output file if the 'new_section'
2943 type and flags of the resulting file. */
2983 renaming the containing section in the output file. */
3171 order they are required in the output file. */
3191 section group in the input file. This means we must
3195 one input file and sections B and C in another input file
3198 file. */
3224 gettext ("cannot create section for output file: %s"),
3234 section group in the output file should contain
3287 /* Create a new section in the output file and add all data
3294 gettext ("cannot create section for output file: %s"),
3330 gettext ("cannot create section for output file: %s"),
3921 cannot create GNU hash table section for output file: %s"),
4072 cannot create hash table section for output file: %s"),
4180 /* If the file byte order is the same as the host byte order
4188 /* Convert the data to file byte order. */
4192 cannot convert section data to file format: %s"),
4223 /* Compute the SHA1 sum of various parts of the generated file.
4239 /* Compute the MD5 sum of various parts of the generated file.
4291 /* Create the output file.
4294 sections from all input files are written into the output file.
4323 struct usedfiles *file;
4358 gettext ("cannot create symbol table for output file: %s"),
4379 gettext ("cannot create symbol table for output file: %s"),
4408 gettext ("cannot create symbol table for output file: %s"),
4457 gettext ("cannot create section for output file: %s"),
4506 gettext ("cannot create section for output file: %s"),
4538 gettext ("cannot create section for output file: %s"),
4773 gettext ("cannot create section for output file: %s"),
4828 gettext ("cannot create section for output file: %s"),
4848 file = NULL;
4851 /* Accelarate the loop. We cache the file
4854 file. */
4855 if (symrunp->file != file)
4857 /* Remember the file. */
4858 file = symrunp->file;
4859 /* Symbol table data from that file. */
4860 locsymdata = file->symtabdata;
4862 locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
4868 file. So it is sufficient to do the work
4870 file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
4879 /* Get the data from the file. Note that we access
4919 file = NULL;
4922 /* Accelarate the loop. We cache the file
4925 file. */
4926 if (symrunp->file != file)
4928 /* Remember the file. */
4929 file = symrunp->file;
4930 /* Symbol table data from that file. */
4931 locsymdata = file->symtabdata;
4933 locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
4940 file. So it is sufficient to do the work
4942 file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
4951 /* Get the data from the file. Using the raw
4998 file = NULL;
5001 /* Accelarate the loop. We cache the file
5004 file. */
5005 if (symrunp->file != file)
5007 /* Remember the file. */
5008 file = symrunp->file;
5009 /* Symbol table data from that file. */
5010 locsymdata = file->symtabdata;
5012 locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
5019 file. So it is sufficient to do the work
5021 file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
5030 /* Get the data from the file. Using the raw
5075 gettext ("cannot create section for output file: %s"),
5087 /* We reuse the data buffer in the input file. */
5090 /* Given that we read the input file from disk we know there
5131 gettext ("cannot create section for output file: %s"),
5198 file = ld_state.relfiles->next;
5211 || file->dynsymtabdata == NULL);
5213 insymdata = file->symtabdata;
5215 inxndxdata = file->xndxdata;
5217 maxcnt = file->nsymtab;
5219 file->symindirect = (Elf32_Word *) xcalloc (maxcnt, sizeof (Elf32_Word));
5223 for (cnt = ld_state.need_symtab ? 1 : file->nlocalsymbols; cnt < maxcnt;
5238 /* Determine the real section index in the source file.
5244 assert (file->scninfo[xndx].allsectionsidx
5246 file->symindirect[cnt] = ld_state.allsections[file->scninfo[xndx].allsectionsidx]->scnsymidx;
5248 no guarantee that the output file will contain all the
5249 sections the input file did. */
5277 assert (cnt >= file->nlocalsymbols);
5278 defp = file->symref[cnt];
5286 /* Determine the real section index in the source file. Use
5291 sym->st_value += file->scninfo[xndx].offset;
5293 assert (file->scninfo[xndx].outscnndx < SHN_LORESERVE
5294 || file->scninfo[xndx].outscnndx > SHN_HIRESERVE);
5295 if (unlikely (file->scninfo[xndx].outscnndx > SHN_LORESERVE))
5305 xndx = file->scninfo[xndx].outscnndx;
5312 sym->st_shndx = file->scninfo[xndx].outscnndx;
5321 assert (cnt >= file->nlocalsymbols);
5322 defp = file->symref[cnt];
5341 + file->symref[cnt]->merge.value);
5362 elf_strptr (file->elf,
5363 file->symstridx,
5374 if (file->has_merge_sections && file->symref[cnt] != NULL
5375 && file->symref[cnt]->merged)
5376 sym->st_value = file->symref[cnt]->merge.value;
5385 if (defp == NULL && cnt >= file->nlocalsymbols)
5387 defp = file->symref[cnt];
5397 search.name = elf_strptr (file->elf, file->symstridx,
5407 file->symref[cnt] = realp;
5418 if (cnt >= file->nlocalsymbols)
5420 assert (file->symref[cnt]->outsymidx == 0);
5421 file->symref[cnt]->outsymidx = nsym;
5423 file->symindirect[cnt] = nsym++;
5426 while ((file = file->next) != ld_state.relfiles->next);
5493 output file and we have reduced the binding of some
5550 if (runp->file->verdefdata != NULL)
5555 (void) xelf_getversym_copy (runp->file->versymdata, runp->symidx,
5562 = ebl_string (runp->file->verdefent[versym]);
5587 /* Now we know how many symbols will be in the output file. Adjust
5600 gettext ("cannot create section for output file: %s"),
5612 gettext ("cannot create section for output file: %s"),
5632 latter is stored in 'symindirect' information of the input file
5787 if (symp->file->versymdata != NULL)
5791 gelf_getversym (symp->file->versymdata, symp->symidx,
5795 &symp->file->verdefused[versym]);
5819 cannot create dynamic symbol table for output file: %s"),
5857 - the symbol is for a file
5914 /* Synthetic symbols (i.e., those with no file attached)
5916 if (symp->file != NULL && symp->file->verdefdata != NULL)
5920 gelf_getversym (symp->file->versymdata, symp->symidx,
5924 &symp->file->verdefused[versym]);
6062 gettext ("cannot create symbol table for output file: %s"),
6199 = groups->symbol->file->symindirect[groups->symbol->symidx];
6202 assert (groups->symbol->file->symref[groups->symbol->symidx]
6204 si = groups->symbol->file->symref[groups->symbol->symidx]->outsymidx;
6241 /* If we create a DSO or the file is linked against DSOs we have
6265 differs from the file layout). */
6267 error (EXIT_FAILURE, 0, gettext ("while determining file layout: %s"),
6398 consecutive in the file. This is true here because
6411 in the file. */
6903 /* Create the relocations for the output file. */
6978 /* Finalize the output file. */
6982 /* Write out the ELF file data. */
6984 error (EXIT_FAILURE, 0, gettext ("while writing output file: %s"),
6989 error (EXIT_FAILURE, 0, gettext ("while finishing output file: %s"),
6992 /* Get the file status of the temporary file. */
6995 error (EXIT_FAILURE, errno, gettext ("cannot stat output file"));
6997 /* Now it's time to rename the file. Remove an old existing file
7001 error (EXIT_FAILURE, errno, gettext ("cannot rename output file"));
7003 /* Make sure the output file is really the one we created. */
7009 /* Wow, somebody overwrote the output file, probably some intruder. */
7012 WARNING: temporary output file overwritten before linking finished"));
7015 /* Close the file descriptor. */
7018 /* Signal the cleanup handler that the file is correctly created. */