ppc, ppc64: tag global symbols as functions #24

Merged
q66 merged 2 commits from ppc-fixes into master 2021-01-08 09:24:00 +00:00
q66 commented 2021-01-08 03:29:32 +00:00 (Migrated from github.com)

it is necessary to tag these symbols as functions otherwise the linker gets confused; this previously manifested as the internal
functions (pre-rename) like __getcontext leaking into the symbol table of things linked against libucontext that used the ucontext POSIX API through the weak aliases

it also had another bad effect and that is if you tried to use libucontext's API (post-rename), the linker would warn you during
compile time that the type is unknown, and the resulting program would crash at runtime

after properly tagging everything, I no longer notice any leakage, i.e. there don't seem to be any references to the aliased symbols
in the resulting symbol table when using the aliases, and using the libucontext prefixed symbols directly also works

we talked about this in IRC previously, and I wanted to finally get this out of the way; after this is fixed it'll be needed to bump soname for next release

it is necessary to tag these symbols as functions otherwise the linker gets confused; this previously manifested as the internal functions (pre-rename) like `__getcontext` leaking into the symbol table of things linked against `libucontext` that used the `ucontext` POSIX API through the weak aliases it also had another bad effect and that is if you tried to use `libucontext`'s API (post-rename), the linker would warn you during compile time that the type is unknown, and the resulting program would crash at runtime after properly tagging everything, I no longer notice any leakage, i.e. there don't seem to be any references to the aliased symbols in the resulting symbol table when using the aliases, and using the `libucontext` prefixed symbols directly also works we talked about this in IRC previously, and I wanted to finally get this out of the way; after this is fixed it'll be needed to bump soname for next release
q66 commented 2021-01-08 03:48:05 +00:00 (Migrated from github.com)

perhaps these should be reimplemented with the common FUNC/END/ALIAS macros though? while at it, why isn't libucontext_trampoline tagged hidden in other archs?

perhaps these should be reimplemented with the common `FUNC`/`END`/`ALIAS` macros though? while at it, why isn't `libucontext_trampoline` tagged hidden in other archs?
q66 commented 2021-01-08 03:53:57 +00:00 (Migrated from github.com)

added a second commit which uses the common macros in ppc*

added a second commit which uses the common macros in `ppc*`
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/libucontext#24
There is no content yet.