Skip to content

Commit 3bad65d

Browse files
committed
HermitCore switchs to relocatable binaries
- switch to relocatbale binaries to realize ASLR - remove all dependencies to gcc
1 parent 45060c2 commit 3bad65d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
use crate::spec::{LinkerFlavor, Target, TargetResult};
1+
use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetResult};
22

33
pub fn target() -> TargetResult {
44
let mut base = super::hermit_base::opts();
55
base.max_atomic_width = Some(128);
6-
base.unsupported_abis = super::arm_base::unsupported_abis();
7-
base.linker = Some("aarch64-hermit-gcc".to_string());
86

97
Ok(Target {
108
llvm_target: "aarch64-unknown-hermit".to_string(),
@@ -16,7 +14,7 @@ pub fn target() -> TargetResult {
1614
target_os: "hermit".to_string(),
1715
target_env: String::new(),
1816
target_vendor: "unknown".to_string(),
19-
linker_flavor: LinkerFlavor::Gcc,
17+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
2018
options: base,
2119
})
2220
}

src/librustc_target/spec/hermit_base.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub fn opts() -> TargetOptions {
1616
pre_link_args,
1717
panic_strategy: PanicStrategy::Abort,
1818
position_independent_executables: true,
19-
relocation_model: RelocModel::Static,
19+
static_position_independent_executables: true,
20+
relocation_model: RelocModel::Pic,
2021
target_family: None,
2122
tls_model: TlsModel::InitialExec,
2223
..Default::default()

src/librustc_target/spec/hermit_kernel_base.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ pub fn opts() -> TargetOptions {
1717
pre_link_args,
1818
panic_strategy: PanicStrategy::Abort,
1919
position_independent_executables: true,
20-
relocation_model: RelocModel::Static,
20+
static_position_independent_executables: true,
21+
relocation_model: RelocModel::Pic,
2122
target_family: None,
2223
tls_model: TlsModel::InitialExec,
2324
..Default::default()

0 commit comments

Comments
 (0)