Commit Graph

10 Commits

Author SHA1 Message Date
Yi-yo Chiang
9b82bd1bcf Merge "Print undemanglable symbols in vndk-vtable-dumper"
am: fddbb8c61a

Change-Id: I15795e907a98d511fb0d3cbeccd73f34dd9e1f26
2018-08-02 23:26:27 -07:00
Treehugger Robot
fddbb8c61a Merge "Print undemanglable symbols in vndk-vtable-dumper" 2018-08-03 06:18:55 +00:00
Yi-yo Chiang
adfe53f551 Print undemanglable symbols in vndk-vtable-dumper
Instead of skipping the vtable entry, vndk-vtable-dumper now prints
undemanglable vtable entries.
Vtables should always contain C++ symbols (mangled symbols). The only
exceptions are when vtables contain pure virtual or deleted
virtual functions. In that case the vtable may contain C symbols
(unmangled symbols) of __cxa_pure_virtual or __cxa_deleted_virtual.
In that case we just print the undemanglable C symbol as its mangled and
demangled name, though technically its not mangled.

Bug: 111968285
Test: m vndk-vtable-dumper
Test: vndk-vtable-dumper android.frameworks.displayservice@1.0.so
Test: vndk-vtable-dumper android.frameworks.displayservice@1.0.so -mangled
Change-Id: I4d1c99ba23a327fd5709233a38d309180c9cfd43
2018-08-03 06:04:50 +00:00
Yi-yo Chiang
36e8d459d3 Merge "Check machine arch before detecting relocation type"
am: 36efe44516

Change-Id: Ibca32ca680dc5b5e5ccd61c3a0bb974321f02510
2018-08-02 19:02:55 -07:00
Yi-yo Chiang
0a93212704 Check machine arch before detecting relocation type
This commit makes vndk-vtable-dumper to check ELF file machine arch
(x86/x86_64/arm/arm64) when detecting relocation type, as relocation
type constants such as R_ARM_ABS32, R_386_32 are not gauranteed to be
unique across different machines.

Test: m vndk-vtable-dumper
Test: vndk-vtable-dumper libziparchive.so # with x86/x86_64/arm/arm64 arch
Change-Id: I58d6d7bff7b7eb16e96cbe02f4989e45a17fd295
2018-08-02 17:51:36 +08:00
Yi-yo Chiang
7268e66d3a Merge "Fix vtable boundary check in vndk-vtable-dumper"
am: 3369b670ac

Change-Id: I85b0c51f4d68bc5fa4644ae00a8ef3d1ac5aa1cb
2018-07-06 03:40:57 -07:00
Yi-yo Chiang
a203b62ab9 Fix vtable boundary check in vndk-vtable-dumper
Add check for vtable boundary in identifyVTable().
Fix check for section boundary in identifyAddend().

Test: vndk-vtable-dumper libtest1.so -mangled
Bug: 111146760
Change-Id: If1369760823323f3bc5094121a5ce510714f8a93
2018-07-05 17:37:13 +08:00
Jayant Chowdhary
f0641b065f vndk-vtable-dumper: Use demangled name of symbol while handling symbol aliasing.
While trying to handle cases where multiple symbols could be aliased, we
were trying to relate a symbol to its class by trying to find the
class' demangled name as a substring of the symbol's mangled name. This
might lead to errors when the class is in a qualified namespace (due to
C++ mangled names having fully qualified namespaces of the form
<num-letters><namespace>. Having <num-letters> interspersed between namespaces
makes finding the substring inaccurate). Now, we try find the class' demangled
name in the demangled symbol name instead.

Bug: 80088849

Test: Without this change, vndk-vtable-dumper for
      libstagefright_bufferqueue_helper.so has an incorrect entry in the
      vtable for android::GraphicsBuffer at offset 20 :
      _ZNK7android6VectorIiE12do_constructEPvj

Test: With this change, vndk-vtable-dumper for
      libstagefright_bufferqueue_helper.so has the correct entry in the
      vtable for android::GraphicsBuffer at offset 20 :
      _ZN7android19GraphicBufferSource23onSidebandStreamChangedEv

Change-Id: I16507f3cef4d9c252aae3d27bef34563e2679703
2018-05-22 18:09:07 +00:00
Hsin-Yi Chen
f9fbef2e17 Add option to print mangled function names
To compare vtable in VTS ABI test, add the option -mangled to have
vndk-vtable-dumper print mangled function names. If the option is not
specified, print demangled names.

Bug: 37488823
Test: tests/test_vndk_vtable_dumper.py
Test: vndk-vtable-dumper -mangled libhidlbase.so
Change-Id: I0a57089425298d311e2366adb933c4c752a37b03
2017-06-03 13:18:57 +00:00
Logan Chien
7b7bdb760e vtable-dumper: Rename to vndk-vtable-dumper.
This commit renames llvm-figure-out-vtables to vndk-vtable-dumper.

Test: ./tests/test_vndk_vtable_dumper.py
Change-Id: I614a1fb0e8ddc89b32a8245322b0f198a363f6a0
2017-02-09 14:56:24 +08:00