Lines Matching defs:file

3    This file is part of elfutils.
5 This file is free software; you can redistribute it and/or modify
50 /* If there was a pre-primed file name left that the callback left
51 behind, try to open that file name. */
69 /* Elf file already open and looks fine. */
76 open_elf (Dwfl_Module *mod, struct dwfl_file *file)
78 Dwfl_Error error = open_elf_file (&file->elf, &file->fd, &file->name);
82 GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (file->elf, &ehdr_mem);
86 elf_end (file->elf);
87 file->elf = NULL;
88 close (file->fd);
89 file->fd = -1;
95 /* In any non-ET_REL file, we compute the "synchronization address".
99 file, it expands the space between the beginning of the
101 change wasn't made in the debug file, the distance from
109 This cannot happen in a prelinked file, since prelink itself
111 (If you do full stripping on a prelinked file, then you get what
113 line it up with a debug file separated before prelinking.)
115 However, when prelink processes an ET_EXEC file, it can do
124 address when there is a separate debug file and a prelinked main
125 file. That is done in find_debuginfo, below. */
128 if (unlikely (elf_getphdrnum (file->elf, &phnum) != 0))
131 file->vaddr = file->address_sync = 0;
135 GElf_Phdr *ph = gelf_getphdr (file->elf, i, &ph_mem);
140 file->vaddr = ph->p_vaddr & -ph->p_align;
141 file->address_sync = ph->p_vaddr + ph->p_memsz;
148 the main ELF file. (It might be changed for the kernel, because
150 the main ELF file, because both find_dw and find_symtab call
151 __libdwfl_getelf first to open the main file. So don't let debug
155 if (file == &mod->main)
160 if (mod->e_type == ET_EXEC && file->vaddr != mod->low_addr)
170 a file by name that doesn't match that ID. */
196 /* We get here when it was the right ELF file. Clear it out. */
206 /* Find the main ELF file for this module and open libelf on it.
227 We'll fetch it from the file when asked. */
256 /* If the main file might have been prelinked, then we need to
264 We can do that in the main file, but in the debug file all the
269 section in the prelinked main file. This shows what the sections
271 direct correspondence to the debug file. */
273 find_prelink_address_sync (Dwfl_Module *mod, struct dwfl_file *file)
364 every file will have some SHT_PROGBITS sections, but it's possible to
457 /* Now we can look at the original section headers of the main file
459 file sections as they are after prelinking, to calculate the
460 synchronization address of the main file. Then we'll apply that
462 synchronization address of the debug file.
511 if (highest > file->vaddr)
512 file->address_sync = highest;
525 /* Find the separate debuginfo file for this module and open libelf on it.
551 might need an alternative (dwz multi) debug file. filename is either
576 Otherwise open either the given file name or use the fd
603 load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
609 while ((scn = elf_nextscn (file->elf, scn)) != NULL)
620 *symfile = file;
635 *symfile = file;
663 /* Translate addresses into file offsets.
697 /* Translate pointers into file offsets. ADJUST is either zero
904 /* Try to find the offset between the main file and .gnu_debugdata. */
908 /* Don't trust the phdrs in the minisymtab elf file to be setup correctly.
909 The address_sync is equal to the main file it is embedded in at first. */
929 /* Try to find the auxiliary symbol table embedded in the main elf file
931 from the main file dynsym. No harm done if not found. */
1063 /* First see if the main ELF file has the debugging information. */
1079 /* Now we have to look for a separate debuginfo file. */
1351 /* Don't keep the file descriptors around. */
1366 dwo file later. */
1377 /* Try to start up libdw on either the main file or the debuginfo file. */
1390 /* First see if the main ELF file has the debugging information. */
1398 /* The Dwarf might need an alt debug file, find that now after
1399 everything about the debug file has been setup (the
1411 /* Now we have to look for a separate debuginfo file. */
1419 /* The Dwarf might need an alt debug file, find that now after
1420 everything about the debug file has been setup (the
1450 relocation to miscellaneous sections in the debug file too. */