Skip to content

Commit

Permalink
Test ARM32 hardcode text
Browse files Browse the repository at this point in the history
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
  • Loading branch information
gmbr3 committed Sep 23, 2024
1 parent 8a120c6 commit 636b23f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gnuefi/crt0-efi-arm.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ optional_header:
.2byte 0x10b // PE32+ format
.byte 0x02 // MajorLinkerVersion
.byte 0x14 // MinorLinkerVersion
.4byte _etext - _start // SizeOfCode
.4byte _text_size - ImageBase // SizeOfCode
.4byte _alldata_size - ImageBase // SizeOfInitializedData
.4byte 0 // SizeOfUninitializedData
.4byte _start - ImageBase // AddressOfEntryPoint
.4byte _start - ImageBase // BaseOfCode
.4byte _text - ImageBase // AddressOfEntryPoint
.4byte _text - ImageBase // BaseOfCode
.4byte _reloc - ImageBase // BaseOfData

extra_header_fields:
Expand All @@ -67,7 +67,7 @@ extra_header_fields:
.4byte _image_end - ImageBase // SizeOfImage

// Everything before the kernel image is considered part of the header
.4byte _start - ImageBase // SizeOfHeaders
.4byte _text - ImageBase // SizeOfHeaders
.4byte 0 // CheckSum
.2byte EFI_SUBSYSTEM // Subsystem
.2byte 0 // DllCharacteristics
Expand Down Expand Up @@ -100,10 +100,10 @@ extra_header_fields:
section_table:

.ascii ".text\0\0\0"
.4byte _evtext - _start // VirtualSize
.4byte _start - ImageBase // VirtualAddress
.4byte _etext - _start // SizeOfRawData
.4byte _start - ImageBase // PointerToRawData
.4byte _text_vsize - ImageBase // VirtualSize
.4byte _text - ImageBase // VirtualAddress
.4byte _text_size - ImageBase // SizeOfRawData
.4byte _text - ImageBase // PointerToRawData
.4byte 0 // PointerToRelocations (0 for executables)
.4byte 0 // PointerToLineNumbers (0 for executables)
.2byte 0 // NumberOfRelocations (0 for executables)
Expand Down Expand Up @@ -148,7 +148,7 @@ section_table:
.2byte 0 // NumberOfLineNumbers
.4byte 0x40000040 // Characteristics (section flags)

.balign 256
.text
.globl _start
.type _start,%function
_start:
Expand Down
1 change: 1 addition & 0 deletions gnuefi/elf_arm_efi.lds
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SECTIONS
{
.text 0 : {
*(.text.head)
. = 0x1000;
_text = .;
*(.text)
*(.text.*)
Expand Down

0 comments on commit 636b23f

Please sign in to comment.