mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
perf genelf: Set ELF program header addresses properly
[ Upstream commit 1af478903fc48c1409a8dd6b698383b62387adf1 ]
The text section starts after the ELF headers so PHDR.p_vaddr and
others should have the correct addresses.
Fixes: babd04386b1df8c3 ("perf jit: Include program header in ELF files")
Reviewed-by: Ian Rogers <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Fangrui Song <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Lieven Hey <[email protected]>
Cc: Milian Wolff <[email protected]>
Cc: Pablo Galindo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
ed903eeb4e
commit
887ab0a444
1 changed files with 3 additions and 3 deletions
|
|
@ -296,9 +296,9 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym,
|
|||
*/
|
||||
phdr = elf_newphdr(e, 1);
|
||||
phdr[0].p_type = PT_LOAD;
|
||||
phdr[0].p_offset = 0;
|
||||
phdr[0].p_vaddr = 0;
|
||||
phdr[0].p_paddr = 0;
|
||||
phdr[0].p_offset = GEN_ELF_TEXT_OFFSET;
|
||||
phdr[0].p_vaddr = GEN_ELF_TEXT_OFFSET;
|
||||
phdr[0].p_paddr = GEN_ELF_TEXT_OFFSET;
|
||||
phdr[0].p_filesz = csize;
|
||||
phdr[0].p_memsz = csize;
|
||||
phdr[0].p_flags = PF_X | PF_R;
|
||||
|
|
|
|||
Loading…
Reference in a new issue