I'm working on an Android phone issue. I can't find a mod for my HTC EVO 4G (Kingdom). Apparently, a company called DxO Labs used DMCA to force Cyanogenmod to remove some HTC mods.
I want to get a list of shared objects built by DxO Labs on the EVO. I have the device so I can enumerate all the shared objects on the device. What I don't know is if ELF DSOs are built with (or could be built with) company information like Windows executables. I don't ever recall coming across them, but I don't believe I ever looked.
Do Linux executables and shared objects in ELF format have a mechanism similar to Windows resource files? Sorry to have to ask. I'm having trouble locating a document on Android's ELF File format and ABI like other platforms have.
Looking at the SYSTEM V APPLICATION BINARY INTERFACE, it is possible to mark objects with company information. From page 81, Notes section:
Sometimes a vendor or system builder needs to mark an object file with special information that other programs will check for conformance, compatibility, etc. Sections of type
SHT_NOTE
and program header elements of typePT_NOTE
can be used for this purpose. The note information in sections and program header elements holds any number of entries, each of which is an array of 4-byte words in the format of the target processor. Labels appear below to help explain note information organization, but they are not part of the specification.+----------------+ | namesz | +----------------+ | descz | +----------------+ | type | +----------------+ | name | +----------------+ | desc | +----------------+
namesz
andname
: The firstnamesz
bytes inname
contain a null-terminated character representation of the entry’s owner or originator. There is no formal mechanism for avoiding name conflicts. By convention, vendors use their own name, such as ‘‘XYZ Computer Company,’’ as the identifier. If no name is present,namesz
contains 0. Padding is present, if necessary, to ensure 4-byte alignment for the descriptor. Such padding is not included innamesz
.
descsz
anddesc
: The firstdescsz
bytes indesc
hold the note descriptor. The ABI places no constraints on a descriptor’s contents. If no descriptor is present,descsz
contains 0. Padding is present, if necessary, to ensure 4-byte alignment for the next note entry. Such padding is not included indescsz
.
type
: This word gives the interpretation of the descriptor. Each originator controls its own types; multiple interpretations of a single type value may exist. Thus, a program must recognize both the name and the type to ‘‘understand’’ a descriptor. Types currently must be nonnegative. The ABI does not define what descriptors mean.
And from page 115 on Vendor Extensions:
Besides the services listed above, libc may contain other symbols. An ABI-conforming system vendor may add a symbol to the C library to provide vendor-specific services. The ABI does not define these services, and programs using these services are not ABI-conforming. Nonetheless, the ABI defines a recommended extension mechanism, providing a way to avoid conflict among the services from multiple vendors.
A symbol of the form
_$vendor.company
. company provides an operating system entry for the vendor named company. The C library does not have unadorned alternatives for these names. Conventionally, a vendor uses the single name to provide multiple services, letting the first argument to_$vendor.company
select among the alternatives. As an example, the ‘‘XYZ Computer Company’’ might add_$vendor.xyz
to the C library.