Skip to content
Snippets Groups Projects
Commit fd3dcf95 authored by Avi Kivity's avatar Avi Kivity
Browse files

elf: ignore EH_FRAME segments

PT_GNU_EH_FRAME segments are contained within PT_LOAD segments, and
so need not be loaded.  Moreover, when we load a segment, we align
it to page boundaries; this overwrites previous contents.  Does
serious damage with small objects (like tst-dir.so) - overwriting
the main function.

Fix by ignoring EH_FRAME segments (libunwind will later re-discover
them when iterating over the objects's phdrs).
parent 274e586e
No related branches found
No related tags found
No related merge requests found
......@@ -206,15 +206,13 @@ namespace elf {
case PT_PHDR:
case PT_GNU_STACK:
case PT_GNU_RELRO:
case PT_GNU_EH_FRAME:
break;
case PT_TLS:
_tls_segment = _base + phdr.p_vaddr;
_tls_init_size = phdr.p_filesz;
_tls_uninit_size = phdr.p_memsz - phdr.p_filesz;
break;
case PT_GNU_EH_FRAME:
load_segment(phdr);
break;
default:
abort();
throw std::runtime_error("bad p_type");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment