Can a statically linked ELF file (with symbols) have two different symbols with same name?
Can a statically linked ELF file (with symbols) have two different symbols with same name?
Absolutely, provided the symbols have local linkage. Example:
// foo.c
static int foo1() { return 42; }
int foo() { return foo1(); }
// bar.c
static int foo1() { return 24; }
int main() { return foo1(); }
gcc -static foo.c bar.c
nm ./a.out | grep ' foo1'
0000000000401c2d t foo1
0000000000401c48 t foo1
QED.