将rust的所有段放在kend前,添加release模式下rustc的优化参数

This commit is contained in:
pointer-to-bios 2024-01-22 17:24:47 +08:00
parent d02f4733e6
commit 7afa51d9ea
2 changed files with 46 additions and 3 deletions

View File

@ -26,8 +26,11 @@ RSCFLAGS = --emit obj --crate-type lib \
-L crate="${PWD}/../rustlib/${ARCH}/src/" \ -L crate="${PWD}/../rustlib/${ARCH}/src/" \
-C code-model=large \ -C code-model=large \
-C relocation-model=static \ -C relocation-model=static \
-C embed-bitcode=no \ -C embed-bitcode=no
-C opt-level=z
ifdef release
RSCFLAGS := -O
endif
ifeq (${ARCH},x86_64) ifeq (${ARCH},x86_64)
RSCFLAGS := ${RSCFLAGS} -C target-feature=-sse,-avx RSCFLAGS := ${RSCFLAGS} -C target-feature=-sse,-avx

View File

@ -62,6 +62,46 @@ SECTIONS {
{} {}
.igot.plt : .igot.plt :
{} {}
.tbss :
{
*(.tbss)
}
.tdata :
{
*(.tdata)
}
.debug_line :
{
*(.debug_line)
}
.debug_abbrev :
{
*(.debug_abbrev)
}
.debug_info :
{
*(.debug_info)
}
.debug_str :
{
*(.debug_str)
}
.debug_aranges :
{
*(.debug_aranges)
}
.debug_ranges :
{
*(.debug_ranges)
}
.debug_pubnames :
{
*(.debug_pubnames)
}
.debug_pubtypes :
{
*(.debug_pubtypes)
}
.kend : .kend :
{ {
*(.kend) *(.kend)