scripts/gendwarfksyms/gendwarfksyms.c
Source file repositories/reference/linux-study-clean/scripts/gendwarfksyms/gendwarfksyms.c
File Facts
- System
- Linux kernel
- Corpus path
scripts/gendwarfksyms/gendwarfksyms.c- Extension
.c- Size
- 4178 bytes
- Lines
- 189
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
fcntl.hgetopt.herrno.hstdarg.hstring.hunistd.hgendwarfksyms.h
Detected Declarations
function usagefunction process_modulefunction main
Annotated Snippet
switch (opt) {
case 0:
break;
case 'd':
debug = 1;
break;
case 's':
stable = 1;
break;
case 'T':
symtypes = 1;
symtypes_file = optarg;
break;
case 'h':
usage();
return 0;
default:
usage();
return 1;
}
}
if (dump_die_map)
dump_dies = 1;
if (optind >= argc) {
usage();
error("no input files?");
}
if (!symbol_read_exports(stdin))
return 0;
if (symtypes_file) {
symfile = fopen(symtypes_file, "w");
if (!symfile)
error("fopen failed for '%s': %s", symtypes_file,
strerror(errno));
}
for (n = optind; n < argc; n++) {
Dwfl *dwfl;
int fd;
fd = open(argv[n], O_RDONLY);
if (fd == -1)
error("open failed for '%s': %s", argv[n],
strerror(errno));
symbol_read_symtab(fd);
kabi_read_rules(fd);
dwfl = dwfl_begin(&callbacks);
if (!dwfl)
error("dwfl_begin failed for '%s': %s", argv[n],
dwarf_errmsg(-1));
if (!dwfl_report_offline(dwfl, argv[n], argv[n], fd))
error("dwfl_report_offline failed for '%s': %s",
argv[n], dwarf_errmsg(-1));
dwfl_report_end(dwfl, NULL, NULL);
if (dwfl_getmodules(dwfl, &process_module, symfile, 0))
error("dwfl_getmodules failed for '%s'", argv[n]);
dwfl_end(dwfl);
kabi_free();
}
if (symfile)
check(fclose(symfile));
symbol_print_versions();
symbol_free();
return 0;
}
Annotation
- Immediate include surface: `fcntl.h`, `getopt.h`, `errno.h`, `stdarg.h`, `string.h`, `unistd.h`, `gendwarfksyms.h`.
- Detected declarations: `function usage`, `function process_module`, `function main`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.