|
1 | | -use std::io::{stdout, IsTerminal, Write}; |
| 1 | +use std::io::{IsTerminal, Write, stdout}; |
2 | 2 |
|
3 | 3 | use anyhow::Error; |
4 | 4 | use metagoblin::elf; |
5 | 5 | use metagoblin::elf::{ |
6 | | - dynamic, header, program_header, reloc, section_header, sym, Dynamic, RelocSection, |
| 6 | + Dynamic, RelocSection, dynamic, header, program_header, reloc, section_header, sym, |
7 | 7 | }; |
8 | 8 | use metagoblin::strtab::Strtab; |
9 | | -use prettytable::{row, Cell, Row, Table}; |
10 | | -use scroll::ctx::StrCtx; |
| 9 | +use prettytable::{Cell, Row, Table, row}; |
11 | 10 | use scroll::Pread; |
| 11 | +use scroll::ctx::StrCtx; |
12 | 12 | use termcolor::Color::*; |
13 | 13 | use termcolor::{Buffer, BufferWriter, ColorChoice, ColorSpec, WriteColor}; |
14 | 14 |
|
15 | | -use crate::format::*; |
16 | 15 | use crate::Opt; |
| 16 | +use crate::format::*; |
17 | 17 |
|
18 | 18 | type Syms = Vec<sym::Sym>; |
19 | 19 |
|
@@ -155,7 +155,7 @@ impl<'bytes> Elf<'bytes> { |
155 | 155 | } |
156 | 156 |
|
157 | 157 | fn ph_name_table(phdr: &elf::ProgramHeader) -> Cell { |
158 | | - use program_header::{pt_to_str, PT_DYNAMIC, PT_INTERP, PT_LOAD}; |
| 158 | + use program_header::{PT_DYNAMIC, PT_INTERP, PT_LOAD, pt_to_str}; |
159 | 159 |
|
160 | 160 | let name = pt_to_str(phdr.p_type); |
161 | 161 | match phdr.p_type { |
@@ -430,9 +430,9 @@ impl<'bytes> Elf<'bytes> { |
430 | 430 |
|
431 | 431 | fn print_dynamic_symbol(&self, fmt: &mut Buffer, dyn_sym: &elf::Dyn) -> Result<(), Error> { |
432 | 432 | use dynamic::{ |
433 | | - tag_to_str, DT_FINI, DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_GNU_HASH, DT_INIT, |
434 | | - DT_INIT_ARRAY, DT_INIT_ARRAYSZ, DT_JMPREL, DT_NEEDED, DT_PLTGOT, DT_PLTRELSZ, DT_RELA, |
435 | | - DT_RELASZ, DT_RPATH, DT_STRSZ, DT_STRTAB, DT_SYMTAB, DT_VERNEED, DT_VERSYM, |
| 433 | + DT_FINI, DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_GNU_HASH, DT_INIT, DT_INIT_ARRAY, |
| 434 | + DT_INIT_ARRAYSZ, DT_JMPREL, DT_NEEDED, DT_PLTGOT, DT_PLTRELSZ, DT_RELA, DT_RELASZ, |
| 435 | + DT_RPATH, DT_STRSZ, DT_STRTAB, DT_SYMTAB, DT_VERNEED, DT_VERSYM, tag_to_str, |
436 | 436 | }; |
437 | 437 |
|
438 | 438 | fmt_cyan(fmt, &format!("{:>16} ", tag_to_str(dyn_sym.d_tag)))?; |
@@ -491,14 +491,16 @@ impl<'bytes> Elf<'bytes> { |
491 | 491 | fmt_off(fmt, header.e_phoff)?; |
492 | 492 | write!(fmt, " e_shoff: ")?; |
493 | 493 | fmt_off(fmt, header.e_shoff)?; |
494 | | - writeln!(fmt, " e_flags: {:#x} e_ehsize: {} e_phentsize: {} e_phnum: {} e_shentsize: {} e_shnum: {} e_shstrndx: {}", |
495 | | - header.e_flags, |
496 | | - header.e_ehsize, |
497 | | - header.e_phentsize, |
498 | | - header.e_phnum, |
499 | | - header.e_shentsize, |
500 | | - header.e_shnum, |
501 | | - header.e_shstrndx, |
| 494 | + writeln!( |
| 495 | + fmt, |
| 496 | + " e_flags: {:#x} e_ehsize: {} e_phentsize: {} e_phnum: {} e_shentsize: {} e_shnum: {} e_shstrndx: {}", |
| 497 | + header.e_flags, |
| 498 | + header.e_ehsize, |
| 499 | + header.e_phentsize, |
| 500 | + header.e_phnum, |
| 501 | + header.e_shentsize, |
| 502 | + header.e_shnum, |
| 503 | + header.e_shstrndx, |
502 | 504 | )?; |
503 | 505 | writeln!(fmt)?; |
504 | 506 |
|
|
0 commit comments