• ELF文件解析


    Display the contents of the symbol table(s)

    objdump --syms -F elf_file > elf_file.symbol

    objdump -h -S elf_file > elf_file.header

    $(LD) $(CODE_LDFLAGS) -T $(CODE_LD_SCR) -Map $(CODE_LD_MAP) -o $@ $^ $(CODE_LIB_OPTS) $(GCC_LIB) $(CODE_DEC_LIB_OPTS) 
    $(OD) -Mno-aliases,numeric -d $@ > $@.od
    $(READELF) -a $@ > $@.elf.txt
    $(OC) --only-section .text -O binary $@ $@.text.bin
    $(OC) --only-section .data -O binary $@ $@.data.bin
    
     
    
    ld  $(LDFLAG) -T ld_script -Map out_map -o out.exe LIBS
    objcopy --only-section .data -O binary elf_file out.data.bin    ##输出文件可以用于.rodata初始化
    objcopy --only-section .text -O binary elf_file out.text.bin
    objdump -Mno-aliases,numeric -d elf_file > elf_file.od
    readelf -a elf_file > elf_file.elf.txt
    $ objdump --help
    Usage: objdump <option(s)> <file(s)>
     Display information from object <file(s)>.
     At least one of the following switches must be given:
      -a, --archive-headers    Display archive header information
      -f, --file-headers       Display the contents of the overall file header
      -p, --private-headers    Display object format specific file header contents
      -P, --private=OPT,OPT... Display object format specific contents
      -h, --[section-]headers  Display the contents of the section headers
      -x, --all-headers        Display the contents of all headers
      -d, --disassemble        Display assembler contents of executable sections
      -D, --disassemble-all    Display assembler contents of all sections
      -S, --source             Intermix source code with disassembly

    https://blog.csdn.net/ccwwff
    https://blog.csdn.net/ccwwff/article/details/95225279

  • 相关阅读:
    2019.7.28刷题统计
    2019.7.27刷题统计
    2019.7.26刷题统计
    2019.7.22刷题统计
    qdoj.xyz 6.18
    qdoj.xyz 6.17
    qdoj.xyz 6.16
    qdoj.xyz 6.15
    qdoj.xyz 6.14
    qdoj.xyz 6.13
  • 原文地址:https://www.cnblogs.com/sinferwu/p/14572769.html
Copyright © 2020-2023  润新知