SymbolRef and getSize

Hi everyone,

I’m currently playing with the clang driver and I encounter a strange bug.

It occurs when I used the getSize function from the SymbolRef class.

On iOS, the number returned is not always correct (some function have the right size).

Sadly,

This is my code (at the end of the main function into driver.cpp) :

Hi everyone,

I’m currently playing with the clang driver and I encounter a strange bug.

It occurs when I used the getSize function from the SymbolRef class.

On iOS, the number returned is not always correct (some function have the right size).

Only ELF has usable size information, MachO and COFF do not. That's also the reason why SymbolRef::getSize doesn't exist anymore in LLVM trunk. To get the real sizes you can either use the address trick used by MachODump.cpp or use computeSymbolSizes which wraps this in a convenient API.

- Ben

Ok thanks for the answer. I will try the computeSymbolSizes.

Johan