kamlesh kumar
2018-10-05 07:43:34 UTC
Hi devs,
Consider following test case:
$cat test.c
extern int print();
extern int xprint();
int main()
{
print();
xprint();
return 0;
}
$ gcc -c test.c
$nm test.o
0000000000000000 T main
U print
U xprint
$objcopy --redefine-sym print=xprint test.o
$nm test.o
0000000000000000 T main
U xprint
U xprint
As you can see there is the two symbols with same name "xprint" and in
this case the objcopy should had merged the xprint in the symbol table
to one instance (provided both has same symbol attributes ) .
Is that bug in the objcopy utility or do we are missing something here ?
Thank you
Kamlesh
Consider following test case:
$cat test.c
extern int print();
extern int xprint();
int main()
{
print();
xprint();
return 0;
}
$ gcc -c test.c
$nm test.o
0000000000000000 T main
U print
U xprint
$objcopy --redefine-sym print=xprint test.o
$nm test.o
0000000000000000 T main
U xprint
U xprint
As you can see there is the two symbols with same name "xprint" and in
this case the objcopy should had merged the xprint in the symbol table
to one instance (provided both has same symbol attributes ) .
Is that bug in the objcopy utility or do we are missing something here ?
Thank you
Kamlesh