qualcomm/eld

We should report warning if different shared libraries have the same SO name

Ouverte

#51 ouverte le 21 avr. 2025

 (4 commentaires) (1 réaction) (1 personne assignée)C++ (73 forks)auto 404
diagnosticsgood first issue

Métriques du dépôt

Stars
 (254 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

It would be nice if linker reports a warning if different shared libraries present in the link have the same SO name.

For example, we should report warning for the below example where lib1.so and lib2.so have the same SO name.

#!/usr/bin/env bash

cat >1.c <<\EOF
int foo() { return 1; }
EOF

cat >2.c <<\EOF
int bar() { return 3; }
EOF

clang -o 1.o 1.c -target arm -c -ffunction-sections
clang -o 2.o 2.c -target arm -c -ffunction-sections
ld.eld -o lib1.so 1.o -shared -soname=foo
ld.eld -o lib2.so 2.o -shared -soname=foo
ld.eld -o a.out /dev/null lib1.so lib2.so

Guide contributeur