Skip to content
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

Swap position of -ldl in CC command #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piotr1212
Copy link

For unknown reasons to me having the -ldl flag not at the end of the CC command fails.

On Ubuntu 18.04

LD_PRELOAD=/somepath/nosync.so cat
cat: symbol lookup error: /media/home/ppopieluch/nosync/nosync.so: undefined symbol: dlsym

ldd output, note libdl is missing:

ldd nosync.so
        linux-vdso.so.1 (0x00007ffdf27e9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a29b84000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6a2a177000)

After recompiling with the flag it is linked correctly:

ldd nosync.so
        linux-vdso.so.1 (0x00007ffd6ff25000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0c0ac9e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0c0a8ad000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0c0b0a4000)

For unknown reasons to me having the -ldl flag not at the end of the CC command fails.

On Ubuntu 18.04
```
LD_PRELOAD=/nosync/nosync.so cat
cat: symbol lookup error: /media/home/ppopieluch/nosync/nosync.so: undefined symbol: dlsym

```

ldd output, note libdl is missing:
```
ldd nosync.so
        linux-vdso.so.1 (0x00007ffdf27e9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a29b84000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6a2a177000)
```

After recompiling with the flag it is linked correctly:
```
ldd nosync.so
        linux-vdso.so.1 (0x00007ffd6ff25000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0c0ac9e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0c0a8ad000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0c0b0a4000)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant