mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 08:39:28 +00:00
loongarch: Add support for ELF psABI v2.00 relocations
A new set of relocation types was added in the LoongArch ELF psABI v2.00 spec [1], [2] to replace the stack-based scheme in v1.00. Toolchain support is available from binutils 2.40 and gcc 13 onwards. This patch adds support for the new relocation types, that are simpler to handle (in particular, stack operations are gone). Support for the v1.00 relocs are kept for now, for compatibility with older toolchains. [1] https://github.com/loongson/LoongArch-Documentation/pull/57 [2] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_appendix_revision_history Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
b264f098be
commit
0b4693e32c
7 files changed
+193
-4
No files matched your search
@@ -860,6 +860,21 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$target_cpu" = xloongarch64; then
|
||||
AC_CACHE_CHECK([whether _mno_explicit_relocs works], [grub_cv_cc_mno_explicit_relocs], [
|
||||
CFLAGS="$TARGET_CFLAGS -mno-explicit-relocs -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_mno_explicit_relocs=yes],
|
||||
[grub_cv_cc_mno_explicit_relocs=no])
|
||||
])
|
||||
if test "x$grub_cv_cc_mno_explicit_relocs" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-explicit-relocs -fno-plt"
|
||||
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -mno-explicit-relocs -fno-plt"
|
||||
fi
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mla-global-with-abs"
|
||||
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mla-global-with-abs"
|
||||
fi
|
||||
|
||||
# GRUB doesn't use float or doubles at all. Yet some toolchains may decide
|
||||
# that floats are a good fit to run instead of what's written in the code.
|
||||
# Given that floating point unit is disabled (if present to begin with)
|
||||
|
||||
Reference in new issue
Block a user