Skip to content

Unnecessary symbols marked as PHP_SCYLLADB_API #119

@CharlemagneLasse

Description

@CharlemagneLasse

According to the PHP documentation https://wiki.php.net/internals/extensions, only get_module is exported. But there are still an enormous amount of symbols exported - see https://github.com/search?q=repo%3Ahe4rt%2Fscylladb-php-driver%20PHP_SCYLLADB_API&type=code

Doing things like this exports internal structures & functions, requires slower indirect access (via things like PLT/GOT) and in this process can trigger problems as described in #118. And it reduces the effectiveness of LTO and -ffunction-sections -fdata-sections with -Wl,--gc-sections

It must be checked why this was introduced in the first place. Most likely, PHP_SCYLLADB_API should be dropped completely. The only interesting function get_modules is already marked as ZEND_DLEXPORT.

The exports itself can be verified using:

objdump -T  cassandra.so| grep -v '\s\*UND\*\s'

only

000000000001f340 g    DF .text  0000000000000008  Base        get_module

should be seen here when the binary was compiled with -fvisibility=hidden -fvisibility-inlines-hidden in target_compile_options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions