Skip to content

Commit ade5a90

Browse files
committed
skip non-.text sections when searching for the function pointer
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
1 parent fa37c37 commit ade5a90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/codegen.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,12 @@ static uint64_t compute_obj_symsize(const object::ObjectFile *obj, uint64_t offs
12261226
object::SectionRef Section = *I;
12271227
#endif
12281228
uint64_t SAddr, SSize;
1229+
#ifdef LLVM35
1230+
if (!Section.isText()) continue;
1231+
#else
1232+
bool isText;
1233+
if (Section.isText(isText) || !isText) continue;
1234+
#endif
12291235
#ifdef LLVM36
12301236
SAddr = Section.getAddress();
12311237
SSize = Section.getSize();

0 commit comments

Comments
 (0)