-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ld.elf_so: Add stub library to access non-POSIX rtld api
JIRA: RTOS-664
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Makefile for Phoenix-RTOS librtld_stubs | ||
# | ||
# Copyright 2024 Phoenix Systems | ||
# | ||
|
||
# Make library with stubs of non POSIX functions. | ||
# This is required as this linker doesn't allow to add itself to NEEDED libs. | ||
# To resolve a symbol from linker in dynamic binary a weak symbol is required. | ||
NAME := librtld_stubs | ||
LOCAL_SRCS := librtld_stubs.c | ||
include $(shared-lib.mk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* librtld_stubs | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Hubert Badocha | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#include <stdlib.h> | ||
|
||
#include "../include/NetBSD/dlfcn.h" | ||
#include "../include/NetBSD/link_elf.h" | ||
|
||
|
||
void *___dlauxinfo(void) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
int __dlctl(void *a, int b, void *c) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
int __dlinfo(void *a, int b, void *c) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
void *__dlvsym(void * restrict a, const char * restrict b, const char * restrict c) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
void ____dl_cxa_refcount(void *a, ssize_t b) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
int __dl_iterate_phdr(int (*a)(struct dl_phdr_info *, size_t, void *), void *b) | ||
{ | ||
abort(); | ||
} | ||
|
||
|
||
extern void *_dlauxinfo(void) __attribute__((__pure__, weak, alias("___dlauxinfo"))); | ||
|
||
extern int dlctl(void *, int, void *) __attribute__((weak, alias("__dlctl"))); | ||
extern int dlinfo(void *, int, void *) __attribute__((weak, alias("__dlinfo"))); | ||
extern void *dlvsym(void * restrict, const char * restrict, const char * restrict) __attribute__((weak, alias("__dlvsym"))); | ||
extern void __dl_cxa_refcount(void *, ssize_t) __attribute__((weak, alias("____dl_cxa_refcount"))); | ||
extern int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *) __attribute__((weak, alias("__dl_iterate_phdr"))); |