Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/birros/ld-exported-symbols-demo
Sows how ld exports / hides static library symbols linked to a dynamic library
https://github.com/birros/ld-exported-symbols-demo
c demo dlopen dynamic gcc ld learning library static
Last synced: 2 days ago
JSON representation
Sows how ld exports / hides static library symbols linked to a dynamic library
- Host: GitHub
- URL: https://github.com/birros/ld-exported-symbols-demo
- Owner: birros
- Created: 2023-08-11T15:59:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-11T16:08:55.000Z (over 1 year ago)
- Last Synced: 2024-04-18T06:44:39.143Z (7 months ago)
- Topics: c, demo, dlopen, dynamic, gcc, ld, learning, library, static
- Language: Makefile
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LD exported symbols demo
This repo shows how `ld` exports / hides static library symbols linked to a
dynamic library.> **Note**
> By default, `ld` exports all symbols from linked static libraries.
> To hide symbols from a specific static library, we need to use this flag:
> `--exclude-libs libstatic.a`.## Usage
```shell
$ make env # optional
$ makeRULE run
SYMBOLS FROM libdynamic.so (hidden libstatic.a symbols)
0000000000001020 T hello_from_dynamicSYMBOLS FROM libdynamic_all.so
0000000000001030 T hello_from_dynamic
0000000000001050 T hello_from_staticRUN prog
Hello from prog!CALL hello_from_dynamic FROM libdynamic.so (dynamically linked):
Hello from static!
Hello from dynamic!CALL hello_from_static FROM libdynamic_all.so (dynamically opened):
Hello from static!
```