Skip to content

Commit

Permalink
skip non-.text sections when searching for the function pointer
Browse files Browse the repository at this point in the history
is seems that llvm is unable to compute getAddress for the .debug sections
and instead returns 0
since we know the symbols we care about are in the .text section
just search that section instead

fix #15971
  • Loading branch information
vtjnash committed Apr 28, 2016
1 parent fa37c37 commit ade5a90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,12 @@ static uint64_t compute_obj_symsize(const object::ObjectFile *obj, uint64_t offs
object::SectionRef Section = *I;
#endif
uint64_t SAddr, SSize;
#ifdef LLVM35
if (!Section.isText()) continue;
#else
bool isText;
if (Section.isText(isText) || !isText) continue;
#endif
#ifdef LLVM36
SAddr = Section.getAddress();
SSize = Section.getSize();
Expand Down

0 comments on commit ade5a90

Please sign in to comment.