Code Review for hotspot

Prepared by:simonis on Tue Dec 3 18:34:47 CET 2013
Workspace:/net/usr.work/d046063/OpenJDK/ppc-aix-port/stage/hotspot
Compare against: http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot
Compare against version:5728
Summary of changes: 177 lines changed: 168 ins; 1 del; 8 mod; 569 unchg
Changeset: hotspot.changeset
Author comments:

On PowerPC-64 (and other architectures like for example IA64) a pointer to a function is not just a plain code address, but a pointer to a so called function descriptor (see http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES). This fact is also reflected in the ELF ABI for PowerPC-64.

On architectures like x86 or SPARC, the ELF symbol table contains the start address and size of an object. So for example for a function object (i.e. type FUNC) the symbol table's value field directly represents the starting address and the size field the size of a function. On PPC64 however, the symbol table's value field only contains an index into a PPC64 specific .opd (official procedure descriptors) section, while the size field still holds the size of the corresponding function. In order to get the actual start address of a function, it is necessary to read the corresponding function descriptor entry in the .opd section at the corresponding index and extract the start address from there.

This change extends the current HotSpot ELF utilities to support the .opd (official procedure descriptors) section on PPC64 platforms. It does this by adding a new field m_funcDesc_table of type ElfFuncDescTable to the ElfFile class. The m_funcDesc_table is initialized in the ElfFile::load_tables() in the same way like the symbol table members by parsing the corresponding .opd section if it is available.

The ElfSymbolTable::lookup() method is changed on PPC64 to take an extra ElfFuncDescTable argument. If running on PPC64, this argument is used to do the extra level of indirection through the function description table to get the real start address associated with a symbol.

This change also slightly improves the implementation of ElfSymbolTable::lookup(). Before, the method always iterated over all symbols in the symbol table and returned the one with the highest address below the requested addr argument. This not only could take a significant amount of time for big libraries, it could also return bogus symbols for addresses which were not really covered by that symbol table at all. The new versions additionally uses the symbol table's st_size field to verify that the requested addr argument is indeed within the range covered by the corresponding symbol table entry. If so, the search is stopped and the symbol is returned immediately.

Bug id: JDK-8019929 : PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables - Java Bug System
Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Sdiffs Frames Old New ----- Raw src/share/vm/utilities/elfFile.cpp

rev 5729 : 8019929: PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables
38 lines changed: 36 ins; 0 del; 2 mod; 222 unchg

Cdiffs Udiffs Sdiffs Frames Old New ----- Raw src/share/vm/utilities/elfFile.hpp

rev 5729 : 8019929: PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables
8 lines changed: 8 ins; 0 del; 0 mod; 158 unchg

Cdiffs Udiffs Sdiffs Frames Old New ----- Raw src/share/vm/utilities/elfSymbolTable.cpp

rev 5729 : 8019929: PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables
98 lines changed: 91 ins; 1 del; 6 mod; 119 unchg

Cdiffs Udiffs Sdiffs Frames Old New ----- Raw src/share/vm/utilities/elfSymbolTable.hpp

rev 5729 : 8019929: PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables
33 lines changed: 33 ins; 0 del; 0 mod; 70 unchg

This code review page was prepared using /net/usr.work/d046063/OpenJDK/jdk8/make/scripts/webrev.ksh (vers 24.1-hg+openjdk.java.net).