From f29cb12ec40d889e7354cb93641e5cc9cec0db48 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 27 Feb 2019 16:50:14 +0100 Subject: [PATCH] ARM: Make the ELF headers and footers very similar to x86 again. * lib/arm-mes/elf32-0header.hex2: Modify. * lib/arm-mes/elf32-footer-single-main.hex2: Modify. * lib/arm-mes/elf32-header.hex2: Modify. --- lib/arm-mes/elf32-0header.hex2 | 6 +-- lib/arm-mes/elf32-footer-single-main.hex2 | 4 +- lib/arm-mes/elf32-header.hex2 | 48 +++++++++++------------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/arm-mes/elf32-0header.hex2 b/lib/arm-mes/elf32-0header.hex2 index 7020e793..689f82d3 100644 --- a/lib/arm-mes/elf32-0header.hex2 +++ b/lib/arm-mes/elf32-0header.hex2 @@ -46,7 +46,7 @@ 01 00 00 00 # e_version Indicating original elf &ELF_text # e_entry Address of the entry point -&ELF_program_headers>ELF_base # e_phoff Address of program header table +%ELF_program_headers>ELF_base # e_phoff Address of program header table 00 00 00 00 # e_shoff Address of section header table 00 00 00 00 # e_flags @@ -73,8 +73,8 @@ 00 00 00 00 # ph_offset &ELF_base # ph_vaddr &ELF_base # ph_physaddr -&ELF_end>ELF_base # ph_filesz -&ELF_end>ELF_base # ph_memsz +%ELF_end>ELF_base # ph_filesz +%ELF_end>ELF_base # ph_memsz 07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7 01 00 00 00 # ph_align diff --git a/lib/arm-mes/elf32-footer-single-main.hex2 b/lib/arm-mes/elf32-footer-single-main.hex2 index 511f21b9..a0dbcfba 100644 --- a/lib/arm-mes/elf32-footer-single-main.hex2 +++ b/lib/arm-mes/elf32-footer-single-main.hex2 @@ -47,7 +47,7 @@ 01 00 # st-shndx: 1 # _start -&ELF_str__start>ELF_str # st-name +%ELF_str__start>ELF_str # st-name &_start 10 00 00 00 # st-len : &main - _start 02 # st-info = stt-func= 2 @@ -55,7 +55,7 @@ 01 00 # st-shndx: 1 # main -&ELF_str__main>ELF_str # st-name +%ELF_str__main>ELF_str # st-name &main 10 00 00 00 # st-len : &ELF_data - main 02 # st-info = stt-func= 2 diff --git a/lib/arm-mes/elf32-header.hex2 b/lib/arm-mes/elf32-header.hex2 index fc862788..30ad0f65 100644 --- a/lib/arm-mes/elf32-header.hex2 +++ b/lib/arm-mes/elf32-header.hex2 @@ -44,8 +44,8 @@ 01 00 00 00 # e_version Indicating original elf &ELF_text # e_entry Address of the entry point -&ELF_program_headers>ELF_base # e_phoff Address of program header table -&ELF_section_headers>ELF_base # e_shoff Address of section header table +%ELF_program_headers>ELF_base # e_phoff Address of program header table +%ELF_section_headers>ELF_base # e_shoff Address of section header table 00 00 00 00 # e_flags @@ -71,8 +71,8 @@ 00 00 00 00 # ph_offset &ELF_base # ph_vaddr &ELF_base # ph_physaddr -&ELF_end>ELF_base # ph_filesz -&ELF_end>ELF_base # ph_memsz +%ELF_end>ELF_base # ph_filesz +%ELF_end>ELF_base # ph_memsz 07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7 01 00 00 00 # ph_align @@ -85,8 +85,8 @@ 00 00 00 00 # ph_offset &ELF_base # ph_vaddr &ELF_base # ph_physaddr -&ELF_end>ELF_base # ph_filesz -&ELF_end>ELF_base # ph_memsz +%ELF_end>ELF_base # ph_filesz +%ELF_end>ELF_base # ph_memsz 07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7 01 00 00 00 # ph_align @@ -134,72 +134,72 @@ ## FIXME: M0 for calculations? :ELF_section_header_text -&ELF_shstr__text>ELF_shstr # sh_name +%ELF_shstr__text>ELF_shstr # sh_name 01 00 00 00 # sh_type = SHT_PROGBITS = 1 06 00 00 00 # sh_flags = SHF-ALLOC|SHF-EXEC =2 | 4 = 6 &ELF_text # sh_addr -&ELF_text>ELF_base # sh_offset -&ELF_data>ELF_text # sh_length +%ELF_text>ELF_base # sh_offset +%ELF_data>ELF_text # sh_length 00 00 00 00 # sh_link 00 00 00 00 # sh_info 01 00 00 00 # sh_1? 00 00 00 00 # sh_entsize :ELF_section_header_data -&ELF_shstr__data>ELF_shstr # sh_name +%ELF_shstr__data>ELF_shstr # sh_name 01 00 00 00 # sh_type = SHT_PROGBITS = 1 03 00 00 00 # sh_flags = SHF-WRITE|SHF-ALLOC = 1 | 2 = 3 &ELF_data # sh_addr -&ELF_data>ELF_base # sh_offset -&ELF_sym>ELF_data # sh_length +%ELF_data>ELF_base # sh_offset +%ELF_sym>ELF_data # sh_length 00 00 00 00 # sh_link 00 00 00 00 # sh_info 01 00 00 00 # sh_1? 00 00 00 00 # sh_entsize :ELF_section_header_comment -&ELF_shstr__comment>ELF_shstr # sh_name +%ELF_shstr__comment>ELF_shstr # sh_name 01 00 00 00 # sh_type = SHT_PROGBITS = 1 00 00 00 00 # sh_flags &ELF_comment # sh_addr -&ELF_comment>ELF_base # sh_offset -&ELF_shstr>ELF_comment # sh_length +%ELF_comment>ELF_base # sh_offset +%ELF_shstr>ELF_comment # sh_length 00 00 00 00 # sh_link 00 00 00 00 # sh_info 01 00 00 00 # sh_1? 00 00 00 00 # sh_entsize :ELF_section_header_shstr -&ELF_shstr__shstr>ELF_shstr # sh_name +%ELF_shstr__shstr>ELF_shstr # sh_name 03 00 00 00 # sh_type: str-sht-strtab 00 00 00 00 # sh_flags &ELF_shstr # sh_addr -&ELF_shstr>ELF_base # sh_offset -&ELF_section_headers>ELF_shstr # sh_length +%ELF_shstr>ELF_base # sh_offset +%ELF_section_headers>ELF_shstr # sh_length 00 00 00 00 # sh_link 00 00 00 00 # sh_info 01 00 00 00 # sh_1? 00 00 00 00 # sh_entsize :ELF_section_header_sym -&ELF_shstr__sym>ELF_shstr # sh_name +%ELF_shstr__sym>ELF_shstr # sh_name 02 00 00 00 # sh_type: str-sht-symtab 00 00 00 00 # sh_flags &ELF_sym # sh_addr -&ELF_sym>ELF_base # sh_offset -&ELF_end>ELF_sym # sh_length +%ELF_sym>ELF_base # sh_offset +%ELF_end>ELF_sym # sh_length 06 00 00 00 # sh_link:6 00 00 00 00 # sh_info 01 00 00 00 # sh_1? 10 00 00 00 # sh_entsize :ELF_section_header_str -&ELF_shstr__str>ELF_shstr # sh_name +%ELF_shstr__str>ELF_shstr # sh_name 03 00 00 00 # sh_type: str-sht-strtab 00 00 00 00 # sh_flags &ELF_str # sh_addr -&ELF_str>ELF_base # sh_offset -&ELF_sym>ELF_str # sh_length +%ELF_str>ELF_base # sh_offset +%ELF_sym>ELF_str # sh_length 00 00 00 00 # sh_link 00 00 00 00 # sh_info 01 00 00 00 # sh_1?