Commit c6f09c1
committed
Add -Bsymbolic link option to avoid symbol interposition (apache#432)
### Motivation
There is a case that `libpulsar.so` could unexpectedly call functions from other dependencies.
For example, assuming the application depends on two libraries:
- `libpulsar.so`, which includes the symbols from `libcurl.a` 8.4.0
- `libfoo.so`, which includes the symbols from `libcurl.a` 7.82.0
If the link order is `libfoo.so` first, then the libcurl definitions from 7.82.0 will also be used by `libpulsar.so` and then the application might crash due to the incompatibility. This is an issue specifically with Linux ELF format.
### Modifications
Add the `-Wl,-Bsymbolic` link option for GCC.
(cherry picked from commit d736a1b)1 parent 1c725b4 commit c6f09c1
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
0 commit comments