-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for loongarch64 #1
base: la64/main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
OUTPUT_FORMAT("elf64-loongarch", "elf64-loongarch", "elf64-loongarch") | ||
OUTPUT_ARCH(loongarch) | ||
ENTRY(_start) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这文件哪抄的来着,gnu-efi?要等那边合并么? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不是,基于同目录下的aarch64文件,改了开头2行 |
||
SECTIONS | ||
{ | ||
.text 0x0 : { | ||
_text = .; | ||
*(.text.head) | ||
*(.text) | ||
*(.text.*) | ||
*(.gnu.linkonce.t.*) | ||
_evtext = .; | ||
. = ALIGN(4096); | ||
} | ||
_etext = .; | ||
_text_size = . - _text; | ||
_text_vsize = _evtext - _text; | ||
|
||
. = ALIGN(4096); | ||
.data : | ||
{ | ||
_data = .; | ||
*(.sdata) | ||
*(.data) | ||
*(.data1) | ||
*(.data.*) | ||
*(.got.plt) | ||
*(.got) | ||
|
||
*(.dynamic) | ||
|
||
/* the EFI loader doesn't seem to like a .bss section, so we stick | ||
it all into .data: */ | ||
. = ALIGN(16); | ||
_bss = .; | ||
*(.sbss) | ||
*(.scommon) | ||
*(.dynbss) | ||
*(.bss) | ||
*(COMMON) | ||
_evdata = .; | ||
. = ALIGN(4096); | ||
_bss_end = .; | ||
} | ||
_edata = .; | ||
_data_vsize = _evdata - _data; | ||
_data_size = . - _data; | ||
|
||
/* | ||
* Note that _sbat must be the beginning of the data, and _esbat must be the | ||
* end and must be before any section padding. The sbat self-check uses | ||
* _esbat to find the bounds of the data, and if the padding is included, the | ||
* CSV parser (correctly) rejects the data as having NUL values in one of the | ||
* required columns. | ||
*/ | ||
. = ALIGN(4096); | ||
.sbat : | ||
{ | ||
_sbat = .; | ||
*(.sbat) | ||
*(.sbat.*) | ||
_esbat = .; | ||
. = ALIGN(4096); | ||
_epsbat = .; | ||
} | ||
_sbat_size = _epsbat - _sbat; | ||
_sbat_vsize = _esbat - _sbat; | ||
|
||
. = ALIGN(4096); | ||
.rodata : | ||
{ | ||
_rodata = .; | ||
*(.rela.dyn) | ||
*(.rela.plt) | ||
*(.rela.got) | ||
*(.rela.data) | ||
*(.rela.data*) | ||
|
||
*(.rodata*) | ||
*(.srodata) | ||
*(.dynsym) | ||
*(.dynstr) | ||
. = ALIGN(16); | ||
*(.note.gnu.build-id) | ||
. = ALIGN(4096); | ||
*(.vendor_cert) | ||
*(.data.ident) | ||
_evrodata = .; | ||
. = ALIGN(4096); | ||
} | ||
_erodata = .; | ||
_rodata_size = . - _rodata; | ||
_rodata_vsize = _evrodata - _rodata; | ||
_alldata_size = . - _data; | ||
|
||
/DISCARD/ : | ||
{ | ||
*(.rel.reloc) | ||
*(.eh_frame) | ||
*(.note.GNU-stack) | ||
} | ||
.comment 0 : { *(.comment) } | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -150,7 +150,7 @@ efi_ldflags = ['-T', | |||||
'-L', efi_crtdir, | ||||||
'-L', efi_libdir, | ||||||
join_paths(efi_crtdir, arch_crt)] | ||||||
if host_cpu == 'aarch64' or host_cpu == 'arm' | ||||||
if host_cpu == 'aarch64' or host_cpu == 'arm' or host_cpu == 'loongarch64' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' | ||||||
# instead, and add required symbols manually. | ||||||
efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa'] | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上边那个注释更新一下,these arches don't have