Skip to content

undefined reference to MemStream::MemStream.... #4

@mzs555557

Description

@mzs555557

when I use libfuzzer in libafl to fuzz xpdf4.04. there are some issues:( , how can i solve it?
the build command is

./target/release/libafl_cxx ./fuzz_JBIG2.cc ./xpdf-4.04/build/*/*.a -I ./xpdf-4.04/xpdf/ -I xpdf-4.04/goo -I xpdf-4.04/fofi/ -I xpdf-4.04/splash/ -I xpdf-4.04/ -I xpdf-4.04/build/ -o fuzzer_pdfload -lm -ldl -lpthread -lstdc++ -lgcc -lutil -lrt

the issue report is :

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
/tmp/fuzz_JBIG2-84770a.o: in function `LLVMFuzzerTestOneInput':
fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0xa7): undefined reference to `MemStream::MemStream(char*, unsigned int, unsigned int, Object*)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0xbe): undefined reference to `GlobalParams::GlobalParams(char const*)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0xd1): undefined reference to `globalParams'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0xe1): undefined reference to `GlobalParams::setErrQuiet(int)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0xf7): undefined reference to `GlobalParams::setupBaseFonts(char const*)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x10c): undefined reference to `GlobalParams::setEnableFreeType(char*)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x125): undefined reference to `GlobalParams::setErrQuiet(int)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x139): undefined reference to `PDFDoc::PDFDoc(BaseStream*, GString*, GString*, PDFCore*)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x18e): undefined reference to `XRef::fetch(int, int, Object*, int)'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x20b): undefined reference to `globalParams'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x223): undefined reference to `Object::free()'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x239): undefined reference to `PDFDoc::~PDFDoc()'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x259): undefined reference to `GlobalParams::~GlobalParams()'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x3b2): undefined reference to `PDFDoc::~PDFDoc()'
/usr/bin/ld: fuzz_JBIG2.cc:(.text.LLVMFuzzerTestOneInput[LLVMFuzzerTestOneInput]+0x3d7): undefined reference to `globalParams'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions