Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
schyrsivochter
relibc
Commits
fe3607d4
Verified
Commit
fe3607d4
authored
Dec 06, 2019
by
Jeremy Soller
Browse files
ld_so: Zero mapped memory and panic on unsupported relocation
parent
8ba70792
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ld_so/linker.rs
View file @
fe3607d4
...
...
@@ -193,6 +193,7 @@ impl Linker {
{
return
Err
(
Error
::
Malformed
(
format!
(
"failed to map {}"
,
elf_name
)));
}
ptr
::
write_bytes
(
ptr
as
*
mut
u8
,
0
,
size
);
slice
::
from_raw_parts_mut
(
ptr
as
*
mut
u8
,
size
)
};
println!
(
" mmap {:p}, {:#x}"
,
mmap
.as_mut_ptr
(),
mmap
.len
());
...
...
@@ -404,7 +405,7 @@ impl Linker {
}
reloc
::
R_X86_64_IRELATIVE
=>
(),
// Handled below
_
=>
{
p
rintln
!
(
p
anic
!
(
" {} unsupported"
,
reloc
::
r_to_str
(
rel
.r_type
,
elf
.header.e_machine
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment