lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e14e41b728437743fddebf78f7981ea15f6b8a8.camel@xry111.site>
Date: Mon, 17 Jun 2024 21:38:08 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Huacai Chen <chenhuacai@...nel.org>, chenglulu <chenglulu@...ngson.cn>
Cc: Jinyang He <hejinyang@...ngson.cn>, Nathan Chancellor
 <nathan@...nel.org>,  Peter Zijlstra <peterz@...radead.org>, WANG Xuerui
 <kernel@...0n.name>, Tiezhu Yang <yangtiezhu@...ngson.cn>,  Nick
 Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
 Justin Stitt <justinstitt@...gle.com>,  Youling Tang
 <tangyouling@...inos.cn>, loongarch@...ts.linux.dev,
 linux-kernel@...r.kernel.org,  llvm@...ts.linux.dev,
 mengqinggang@...ngson.cn, cailulu@...ngson.cn,  wanglei@...ngson.cn,
 luweining@...ngson.cn, Yujie Liu <yujie.liu@...el.com>,  Heng Qi
 <hengqi@...ux.alibaba.com>, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC
 unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL

On Mon, 2024-06-17 at 21:11 +0800, Huacai Chen wrote:



> > select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB && !CC_IS_CLANG && !RUST
> Maybe we needn't consider RUST here?

Rustc does use $fp that objtool cannot handle as at now.  It can be
demonstrated with an over-aligned type, similar to Clang:

$ cat t.rs
#[repr(C, align(64))]
struct X(i32);

extern { fn f(x: &X) -> i64; }

#[no_mangle]
fn g() -> i64 {
    let x = X(114514);
    unsafe {f(&x)}
}
$ rustc t.rs --emit=asm --crate-type=staticlib -O
$ grep fp t.s
	st.d	$fp, $sp, 112
	addi.d	$fp, $sp, 128
	addi.d	$sp, $fp, -128
	ld.d	$fp, $sp, 112

The kernel uses rust-bindgen to generate some .rs file from C headers. 
And __attribute__((aligned(x))) is directly translated to
repr(align(x)).  As __attribute__((aligned(x))) is very common in the
kernel I expect objtool will fail to handle some object code from rustc.

> And can we think AS_HAS_THIN_ADD_SUB always imply
> AS_HAS_EXPLICIT_RELOCS here?

Maybe, AFAIK there's no assembler using thin add-sub but not explicit
relocs.

-- 
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ