On 25/01/21 23:15, Laszlo Ersek wrote:
- How does this case differ from the registration of types? type_init() is a constructor function, and it generally ends up adding some structures with function pointers (I reckon) via type_table_add(). The main executable doesn't call into the device code directly -- only the constructor function calls another function from the same module. The main executable only goes through the registered type interfaces. How does the linker know in that case to preserve the whole object?
We use either link_whole or extract_objects() for libraries that have type-registering constructors.
Paolo