mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
Utilities: Make sure columns are properly aligned for readelf on x86_64
This commit is contained in:
parent
29c5dcd2fa
commit
36c3927169
1 changed files with 10 additions and 4 deletions
|
@ -520,6 +520,12 @@ int main(int argc, char** argv)
|
||||||
outln();
|
outln();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ARCH(I386)
|
||||||
|
auto addr_padding = "";
|
||||||
|
#else
|
||||||
|
auto addr_padding = " ";
|
||||||
|
#endif
|
||||||
|
|
||||||
if (display_section_headers) {
|
if (display_section_headers) {
|
||||||
if (!display_all) {
|
if (!display_all) {
|
||||||
outln("There are {} section headers, starting at offset {:#x}:", header.e_shnum, header.e_shoff);
|
outln("There are {} section headers, starting at offset {:#x}:", header.e_shnum, header.e_shoff);
|
||||||
|
@ -530,7 +536,7 @@ int main(int argc, char** argv)
|
||||||
outln("There are no sections in this file.");
|
outln("There are no sections in this file.");
|
||||||
} else {
|
} else {
|
||||||
outln("Section Headers:");
|
outln("Section Headers:");
|
||||||
outln(" Name Type Address Offset Size Flags");
|
outln(" Name Type Address{} Offset{} Size{} Flags", addr_padding, addr_padding, addr_padding);
|
||||||
|
|
||||||
elf_image.for_each_section([](const ELF::Image::Section& section) {
|
elf_image.for_each_section([](const ELF::Image::Section& section) {
|
||||||
out(" {:19} ", section.name());
|
out(" {:19} ", section.name());
|
||||||
|
@ -557,7 +563,7 @@ int main(int argc, char** argv)
|
||||||
outln("There are no program headers in this file.");
|
outln("There are no program headers in this file.");
|
||||||
} else {
|
} else {
|
||||||
outln("Program Headers:");
|
outln("Program Headers:");
|
||||||
outln(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align");
|
outln(" Type Offset VirtAddr{} PhysAddr{} FileSiz MemSiz Flg Align", addr_padding, addr_padding);
|
||||||
|
|
||||||
elf_image.for_each_program_header([](const ELF::Image::ProgramHeader& program_header) {
|
elf_image.for_each_program_header([](const ELF::Image::ProgramHeader& program_header) {
|
||||||
out(" ");
|
out(" ");
|
||||||
|
@ -714,7 +720,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
if (object->symbol_count()) {
|
if (object->symbol_count()) {
|
||||||
// FIXME: Add support for init/fini/start/main sections
|
// FIXME: Add support for init/fini/start/main sections
|
||||||
outln(" Num: Value Size Type Bind Name");
|
outln(" Num: Value{} Size{} Type Bind Name", addr_padding, addr_padding);
|
||||||
object->for_each_symbol([](const ELF::DynamicObject::Symbol& sym) {
|
object->for_each_symbol([](const ELF::DynamicObject::Symbol& sym) {
|
||||||
out(" {:>4}: ", sym.index());
|
out(" {:>4}: ", sym.index());
|
||||||
out("{:p} ", sym.value());
|
out("{:p} ", sym.value());
|
||||||
|
@ -736,7 +742,7 @@ int main(int argc, char** argv)
|
||||||
if (display_symbol_table) {
|
if (display_symbol_table) {
|
||||||
if (elf_image.symbol_count()) {
|
if (elf_image.symbol_count()) {
|
||||||
outln("Symbol table '{}' contains {} entries:", ELF_SYMTAB, elf_image.symbol_count());
|
outln("Symbol table '{}' contains {} entries:", ELF_SYMTAB, elf_image.symbol_count());
|
||||||
outln(" Num: Value Size Type Bind Name");
|
outln(" Num: Value{} Size{} Type Bind Name", addr_padding, addr_padding);
|
||||||
|
|
||||||
elf_image.for_each_symbol([](const ELF::Image::Symbol& sym) {
|
elf_image.for_each_symbol([](const ELF::Image::Symbol& sym) {
|
||||||
out(" {:>4}: ", sym.index());
|
out(" {:>4}: ", sym.index());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue