-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RTLD] Add support for PIC and being build as shared library #334
base: master
Are you sure you want to change the base?
Conversation
FIrst 3 commits are from different PRs |
9687533
to
37487af
Compare
37487af
to
3da17c2
Compare
Unit Test Results6 780 tests - 920 6 154 ✅ - 831 31m 19s ⏱️ - 8m 9s Results for commit 77c8fec. ± Comparison against base commit 3375557. This pull request removes 920 tests.
♻️ This comment has been updated with latest results. |
c2c4a95
to
cfc9a6e
Compare
cfc9a6e
to
77c8fec
Compare
77c8fec
to
ddc8fe7
Compare
__attribute__((noreturn)) | ||
extern void endthreadsvc(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
__attribute__((noreturn)) | |
extern void endthreadsvc(void); | |
__attribute__((noreturn)) extern void endthreadsvc(void); |
sys/threads.c
Outdated
|
||
/* Provide stub definition of tls managing functions for statically linked programs. */ | ||
|
||
static void _libphoenix_stub(void){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
static void _libphoenix_stub(void){ | |
static void _libphoenix_stub(void) | |
{ |
sys/threads.c
Outdated
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_free_curr(void); | ||
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_allocate_curr(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_free_curr(void); | |
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_allocate_curr(void); | |
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_free_curr(void); | |
extern void __attribute__((weak, alias("_libphoenix_stub"))) _rtld_tls_allocate_curr(void); |
sys/threads.c
Outdated
|
||
|
||
/* FIXME: Hack to provide tls support in dynamically loaded binaries. */ | ||
void beginthreadex_wrapper(void* arg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
void beginthreadex_wrapper(void* arg) { | |
void beginthreadex_wrapper(void *arg) | |
{ |
sys/threads.c
Outdated
start(startArg); | ||
} | ||
|
||
int beginthreadex(void (*start)(void *), unsigned int priority, void *stack, unsigned int stacksz, void *arg, handle_t *id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
int beginthreadex(void (*start)(void *), unsigned int priority, void *stack, unsigned int stacksz, void *arg, handle_t *id) { | |
int beginthreadex(void (*start)(void *), unsigned int priority, void *stack, unsigned int stacksz, void *arg, handle_t *id) | |
{ |
sys/threads.c
Outdated
__attribute__((noreturn)) | ||
void endthread(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
__attribute__((noreturn)) | |
void endthread(void) { | |
__attribute__((noreturn)) void endthread(void) | |
{ |
ddc8fe7
to
9fe5f55
Compare
#define RTLD_LAZY 1 | ||
#define RTLD_NOW 2 | ||
#define RTLD_GLOBAL 0x100 | ||
#define RTLD_LOCAL 0x200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
#define RTLD_LAZY 1 | |
#define RTLD_NOW 2 | |
#define RTLD_GLOBAL 0x100 | |
#define RTLD_LOCAL 0x200 | |
#define RTLD_LAZY 1 | |
#define RTLD_NOW 2 | |
#define RTLD_GLOBAL 0x100 | |
#define RTLD_LOCAL 0x200 |
int dladdr(const void *restrict, Dl_info_t *restrict); | ||
int dlclose(void *); | ||
char *dlerror(void); | ||
void *dlopen(const char *, int); | ||
void *dlsym(void *restrict, const char *restrict); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
int dladdr(const void *restrict, Dl_info_t *restrict); | |
int dlclose(void *); | |
char *dlerror(void); | |
void *dlopen(const char *, int); | |
void *dlsym(void *restrict, const char *restrict); | |
int dladdr(const void *restrict, Dl_info_t *restrict); | |
int dlclose(void *); | |
char *dlerror(void); | |
void *dlopen(const char *, int); | |
void *dlsym(void *restrict, const char *restrict); |
2caa8d8
to
b72127e
Compare
rtld/stubs.c
Outdated
|
||
|
||
extern void *__tls_get_addr(void *) __attribute__((weak, alias("__libphoenix__tls_get_addr"))); | ||
extern void *___tls_get_addr(void *) __attribute__((weak, alias("__libphoenix___tls_get_addr"))) __attribute__((__regparm__(1))) ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
extern void *___tls_get_addr(void *) __attribute__((weak, alias("__libphoenix___tls_get_addr"))) __attribute__((__regparm__(1))) ; | |
extern void *___tls_get_addr(void *) __attribute__((weak, alias("__libphoenix___tls_get_addr"))) __attribute__((__regparm__(1))); |
ab44ee8
to
fd5b08c
Compare
static int _libc_initialized; | ||
|
||
|
||
/* _libc_init is called twice once explicitely in crt0 and once during constructor handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
explicitely ==> explicitly
|
||
|
||
/* _libc_init is called twice once explicitely in crt0 and once during constructor handling. | ||
* If libc is linked statically first it is called explicitely and then during constructor handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
explicitely ==> explicitly
3243e14
to
9547eeb
Compare
.text | ||
|
||
.thumb_func | ||
/* Declared as weak to be overriden by dynamic linker */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
overriden ==> overridden
* | ||
* void *__tls_get_addr(TLS_index *ti) */ | ||
|
||
/* Declared as weak to be overriden by dynamic linker */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
overriden ==> overridden
9547eeb
to
bee4ca6
Compare
rtld/stubs.c
Outdated
} | ||
|
||
|
||
__attribute__((weak)) void *__tls_get_addr(void *d) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
__attribute__((weak)) void *__tls_get_addr(void *d) { | |
__attribute__((weak)) void *__tls_get_addr(void *d) | |
{ |
rtld/stubs.c
Outdated
} | ||
|
||
|
||
__attribute__((weak)) void *___tls_get_addr(void *d) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
__attribute__((weak)) void *___tls_get_addr(void *d) { | |
__attribute__((weak)) void *___tls_get_addr(void *d) | |
{ |
bee4ca6
to
cae7c5e
Compare
rtld/stubs.c
Outdated
|
||
|
||
/* As dynamic linker is not added as a NEEDED dependency in libphoenix, stub implementation are required. | ||
* They are overriden by dynamic linkers functions in runtime. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
overriden ==> overridden
rtld/stubs.c
Outdated
|
||
|
||
/* Stub __tls_get_addr implementations. | ||
* They can be overriden on platforms requiring __tls_get_addr in PIC compiled platforms(eg. RISC-V, ARM). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[codespell] reported by reviewdog 🐶
overriden ==> overridden
1fbfbc1
to
531abff
Compare
4e2bbe9
to
0bf6d7d
Compare
rtld/stubs.c
Outdated
} | ||
|
||
|
||
__attribute__((weak)) void __rtld_atfork(int pre) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
__attribute__((weak)) void __rtld_atfork(int pre) { | |
__attribute__((weak)) void __rtld_atfork(int pre) | |
{ |
6f6f34b
to
ab58b63
Compare
d761924
to
0ba38c3
Compare
a561b47
to
47a6b37
Compare
90eeca8
to
046a16f
Compare
JIRA: RTOS-900
JIRA: RTOS-664
In PIE on ia32 function calls should be made using GOT. JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
This allows constructor handling mechanism in dynamic linker. JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
JIRA: RTOS-664
046a16f
to
5a9ff9b
Compare
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment