-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Support build kernelflinger with Slim Bootloader
Build kernelflinger as ELF file Tracked-On: OAM-110589 Signed-off-by: Chen, Gang G <[email protected]>
- Loading branch information
1 parent
a1aedee
commit bf28706
Showing
4 changed files
with
167 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
OUTPUT_FORMAT(elf32-i386) | ||
OUTPUT_ARCH(i386) | ||
|
||
ENTRY(_entry) | ||
|
||
SECTIONS | ||
{ | ||
. = CONFIG_LP_BASE_ADDRESS; | ||
|
||
. = ALIGN(16); | ||
_start = .; | ||
|
||
.text : { | ||
*(.text._entry) | ||
*(.text) | ||
*(.text.*) | ||
} | ||
|
||
.rodata : { | ||
*(.rodata) | ||
*(.rodata.*) | ||
} | ||
|
||
.data : { | ||
*(.data) | ||
*(.data.*) | ||
} | ||
|
||
_edata = .; | ||
|
||
.bss : { | ||
*(.sbss) | ||
*(.sbss.*) | ||
*(.bss) | ||
*(.bss.*) | ||
*(COMMON) | ||
|
||
/* Stack and heap */ | ||
|
||
. = ALIGN(16); | ||
_heap = .; | ||
. += CONFIG_LP_HEAP_SIZE; | ||
. = ALIGN(16); | ||
_eheap = .; | ||
|
||
_estack = .; | ||
. += CONFIG_LP_STACK_SIZE; | ||
. = ALIGN(16); | ||
_stack = .; | ||
} | ||
|
||
_end = .; | ||
|
||
/DISCARD/ : { | ||
*(.comment) | ||
*(.note*) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
ifeq ($(strip $(LOCAL_MODULE_CLASS)),) | ||
LOCAL_MODULE_CLASS := SBL | ||
endif | ||
|
||
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),) | ||
LOCAL_MODULE_SUFFIX := .sbl | ||
endif | ||
|
||
ifeq ($(strip $(LOCAL_MODULE_PATH)),) | ||
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/sbl | ||
endif | ||
|
||
LOCAL_CC := $(IAFW_CC) | ||
LOCAL_CLANG := true | ||
LOCAL_SANITIZE := never | ||
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true | ||
LOCAL_CFLAGS += $(TARGET_IAFW_GLOBAL_CFLAGS) | ||
LOCAL_ASFLAGS += $(TARGET_IAFW_ASFLAGS) | ||
LOCAL_LDFLAGS := $(TARGET_IAFW_GLOBAL_LDFLAGS) -static \ | ||
-T $(TARGET_SBL_LDS) $(LOCAL_LDFLAGS) | ||
# If kernel enforce superpages the .text section gets aligned at | ||
# offset 0x200000 which break multiboot compliance. | ||
LOCAL_LDFLAGS += -z max-page-size=0x1000 | ||
LOCAL_SBL_LDFALGS := $(LOCAL_LDFLAGS) | ||
LOCAL_OBJCOPY_FLAGS := $(TARGET_IAFW_GLOBAL_OBJCOPY_FLAGS) $(LOCAL_OBJCOPY_FLAGS) | ||
|
||
skip_build_from_source := | ||
ifdef LOCAL_PREBUILT_MODULE_FILE | ||
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH))) | ||
include $(BUILD_SYSTEM)/prebuilt_internal.mk | ||
skip_build_from_source := true | ||
endif | ||
endif | ||
|
||
ifndef skip_build_from_source | ||
|
||
ifdef LOCAL_IS_HOST_MODULE | ||
$(error This file should not be used to build host binaries. Included by (or near) $(lastword $(filter-out config/%,$(MAKEFILE_LIST)))) | ||
endif | ||
|
||
WITHOUT_LIBCOMPILER_RT := true | ||
include $(BUILD_SYSTEM)/binary.mk | ||
WITHOUT_LIBCOMPILER_RT := | ||
|
||
LIBPAYLOAD_CRT0_LIB := $(call intermediates-dir-for,STATIC_LIBRARIES,$(LIBPAYLOAD_CRT0))/$(LIBPAYLOAD_CRT0).a | ||
all_objects += $(LIBPAYLOAD_CRT0_LIB) | ||
|
||
$(LOCAL_BUILT_MODULE): PRIVATE_OBJCOPY_FLAGS := $(LOCAL_OBJCOPY_FLAGS) | ||
|
||
#$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries) $(SBLIMAGE) $(SBLSIGN) | ||
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries) | ||
$(call transform-o-to-sbl-executable,$(LOCAL_SBL_LDFALGS)) | ||
|
||
endif # skip_build_from_source | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters