Commit b50a3225 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas

arm64/head: avoid symbol names pointing into first 64 KB of kernel image

We no longer map the first 64 KB of the kernel image, as there is nothing
there that we ever need to refer back to once the kernel has booted. Even
though facilities like kallsyms are very careful to only refer to the
region that starts at _stext when mapping virtual addresses to symbol
names, let's avoid any confusion by switching to local .L prefixed symbol
names for the EFI header, as none of them have any significance to the
rest of the kernel.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201117124729.12642-3-ardb@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent e2a073dd
...@@ -9,28 +9,26 @@ ...@@ -9,28 +9,26 @@
.macro __EFI_PE_HEADER .macro __EFI_PE_HEADER
.long PE_MAGIC .long PE_MAGIC
coff_header:
.short IMAGE_FILE_MACHINE_ARM64 // Machine .short IMAGE_FILE_MACHINE_ARM64 // Machine
.short section_count // NumberOfSections .short .Lsection_count // NumberOfSections
.long 0 // TimeDateStamp .long 0 // TimeDateStamp
.long 0 // PointerToSymbolTable .long 0 // PointerToSymbolTable
.long 0 // NumberOfSymbols .long 0 // NumberOfSymbols
.short section_table - optional_header // SizeOfOptionalHeader .short .Lsection_table - .Loptional_header // SizeOfOptionalHeader
.short IMAGE_FILE_DEBUG_STRIPPED | \ .short IMAGE_FILE_DEBUG_STRIPPED | \
IMAGE_FILE_EXECUTABLE_IMAGE | \ IMAGE_FILE_EXECUTABLE_IMAGE | \
IMAGE_FILE_LINE_NUMS_STRIPPED // Characteristics IMAGE_FILE_LINE_NUMS_STRIPPED // Characteristics
optional_header: .Loptional_header:
.short PE_OPT_MAGIC_PE32PLUS // PE32+ format .short PE_OPT_MAGIC_PE32PLUS // PE32+ format
.byte 0x02 // MajorLinkerVersion .byte 0x02 // MajorLinkerVersion
.byte 0x14 // MinorLinkerVersion .byte 0x14 // MinorLinkerVersion
.long __initdata_begin - efi_header_end // SizeOfCode .long __initdata_begin - .Lefi_header_end // SizeOfCode
.long __pecoff_data_size // SizeOfInitializedData .long __pecoff_data_size // SizeOfInitializedData
.long 0 // SizeOfUninitializedData .long 0 // SizeOfUninitializedData
.long __efistub_efi_pe_entry - _head // AddressOfEntryPoint .long __efistub_efi_pe_entry - _head // AddressOfEntryPoint
.long efi_header_end - _head // BaseOfCode .long .Lefi_header_end - _head // BaseOfCode
extra_header_fields:
.quad 0 // ImageBase .quad 0 // ImageBase
.long SEGMENT_ALIGN // SectionAlignment .long SEGMENT_ALIGN // SectionAlignment
.long PECOFF_FILE_ALIGNMENT // FileAlignment .long PECOFF_FILE_ALIGNMENT // FileAlignment
...@@ -45,7 +43,7 @@ extra_header_fields: ...@@ -45,7 +43,7 @@ extra_header_fields:
.long _end - _head // SizeOfImage .long _end - _head // SizeOfImage
// Everything before the kernel image is considered part of the header // Everything before the kernel image is considered part of the header
.long efi_header_end - _head // SizeOfHeaders .long .Lefi_header_end - _head // SizeOfHeaders
.long 0 // CheckSum .long 0 // CheckSum
.short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem .short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem
.short 0 // DllCharacteristics .short 0 // DllCharacteristics
...@@ -54,7 +52,7 @@ extra_header_fields: ...@@ -54,7 +52,7 @@ extra_header_fields:
.quad 0 // SizeOfHeapReserve .quad 0 // SizeOfHeapReserve
.quad 0 // SizeOfHeapCommit .quad 0 // SizeOfHeapCommit
.long 0 // LoaderFlags .long 0 // LoaderFlags
.long (section_table - .) / 8 // NumberOfRvaAndSizes .long (.Lsection_table - .) / 8 // NumberOfRvaAndSizes
.quad 0 // ExportTable .quad 0 // ExportTable
.quad 0 // ImportTable .quad 0 // ImportTable
...@@ -64,17 +62,17 @@ extra_header_fields: ...@@ -64,17 +62,17 @@ extra_header_fields:
.quad 0 // BaseRelocationTable .quad 0 // BaseRelocationTable
#ifdef CONFIG_DEBUG_EFI #ifdef CONFIG_DEBUG_EFI
.long efi_debug_table - _head // DebugTable .long .Lefi_debug_table - _head // DebugTable
.long efi_debug_table_size .long .Lefi_debug_table_size
#endif #endif
// Section table // Section table
section_table: .Lsection_table:
.ascii ".text\0\0\0" .ascii ".text\0\0\0"
.long __initdata_begin - efi_header_end // VirtualSize .long __initdata_begin - .Lefi_header_end // VirtualSize
.long efi_header_end - _head // VirtualAddress .long .Lefi_header_end - _head // VirtualAddress
.long __initdata_begin - efi_header_end // SizeOfRawData .long __initdata_begin - .Lefi_header_end // SizeOfRawData
.long efi_header_end - _head // PointerToRawData .long .Lefi_header_end - _head // PointerToRawData
.long 0 // PointerToRelocations .long 0 // PointerToRelocations
.long 0 // PointerToLineNumbers .long 0 // PointerToLineNumbers
...@@ -98,7 +96,7 @@ section_table: ...@@ -98,7 +96,7 @@ section_table:
IMAGE_SCN_MEM_READ | \ IMAGE_SCN_MEM_READ | \
IMAGE_SCN_MEM_WRITE // Characteristics IMAGE_SCN_MEM_WRITE // Characteristics
.set section_count, (. - section_table) / 40 .set .Lsection_count, (. - .Lsection_table) / 40
#ifdef CONFIG_DEBUG_EFI #ifdef CONFIG_DEBUG_EFI
/* /*
...@@ -114,21 +112,21 @@ section_table: ...@@ -114,21 +112,21 @@ section_table:
__INITRODATA __INITRODATA
.align 2 .align 2
efi_debug_table: .Lefi_debug_table:
// EFI_IMAGE_DEBUG_DIRECTORY_ENTRY // EFI_IMAGE_DEBUG_DIRECTORY_ENTRY
.long 0 // Characteristics .long 0 // Characteristics
.long 0 // TimeDateStamp .long 0 // TimeDateStamp
.short 0 // MajorVersion .short 0 // MajorVersion
.short 0 // MinorVersion .short 0 // MinorVersion
.long IMAGE_DEBUG_TYPE_CODEVIEW // Type .long IMAGE_DEBUG_TYPE_CODEVIEW // Type
.long efi_debug_entry_size // SizeOfData .long .Lefi_debug_entry_size // SizeOfData
.long 0 // RVA .long 0 // RVA
.long efi_debug_entry - _head // FileOffset .long .Lefi_debug_entry - _head // FileOffset
.set efi_debug_table_size, . - efi_debug_table .set .Lefi_debug_table_size, . - .Lefi_debug_table
.previous .previous
efi_debug_entry: .Lefi_debug_entry:
// EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY // EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY
.ascii "NB10" // Signature .ascii "NB10" // Signature
.long 0 // Unknown .long 0 // Unknown
...@@ -137,9 +135,9 @@ efi_debug_entry: ...@@ -137,9 +135,9 @@ efi_debug_entry:
.asciz VMLINUX_PATH .asciz VMLINUX_PATH
.set efi_debug_entry_size, . - efi_debug_entry .set .Lefi_debug_entry_size, . - .Lefi_debug_entry
#endif #endif
.balign SEGMENT_ALIGN .balign SEGMENT_ALIGN
efi_header_end: .Lefi_header_end:
.endm .endm
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment