mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Make debug output and linking properly pic/pie. Remove non-pic relocation from linker
This commit is contained in:
parent
7d34c88e64
commit
379904fcc5
3 changed files with 2 additions and 5 deletions
|
@ -403,6 +403,7 @@ fn link_linux(
|
||||||
"--eh-frame-hdr",
|
"--eh-frame-hdr",
|
||||||
"-arch",
|
"-arch",
|
||||||
arch_str(target),
|
arch_str(target),
|
||||||
|
"-pie",
|
||||||
libcrt_path.join("crti.o").to_str().unwrap(),
|
libcrt_path.join("crti.o").to_str().unwrap(),
|
||||||
libcrt_path.join("crtn.o").to_str().unwrap(),
|
libcrt_path.join("crtn.o").to_str().unwrap(),
|
||||||
])
|
])
|
||||||
|
|
|
@ -230,6 +230,7 @@ pub fn gen_from_mono_module(
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let llc_args = &[
|
let llc_args = &[
|
||||||
|
"-relocation-model=pic",
|
||||||
"-filetype=obj",
|
"-filetype=obj",
|
||||||
app_bc_file.to_str().unwrap(),
|
app_bc_file.to_str().unwrap(),
|
||||||
"-o",
|
"-o",
|
||||||
|
|
|
@ -1183,11 +1183,6 @@ pub fn surgery(matches: &ArgMatches) -> io::Result<i32> {
|
||||||
}
|
}
|
||||||
target_offset - base_offset + rel.1.addend()
|
target_offset - base_offset + rel.1.addend()
|
||||||
}
|
}
|
||||||
RelocationKind::Absolute => {
|
|
||||||
let target_vaddr = target_offset + new_segment_vaddr as i64;
|
|
||||||
println!("Target: 0x{:x}", target_vaddr);
|
|
||||||
target_vaddr
|
|
||||||
}
|
|
||||||
x => {
|
x => {
|
||||||
println!("Relocation Kind not yet support: {:?}", x);
|
println!("Relocation Kind not yet support: {:?}", x);
|
||||||
return Ok(-1);
|
return Ok(-1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue