Linker How to define a character and undefined at the same time?

$ nm --demangle /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/libsupc++.a  | grep "__cxxabiv1::__class_type_info::~__class_type_info"

gives the following result:

0000000000000000 T __cxxabiv1::__class_type_info::~__class_type_info()
0000000000000000 T __cxxabiv1::__class_type_info::~__class_type_info()
0000000000000000 T __cxxabiv1::__class_type_info::~__class_type_info()
                 U __cxxabiv1::__class_type_info::~__class_type_info()
                 U __cxxabiv1::__class_type_info::~__class_type_info()

So how to interpret this conclusion?

  • Here are a few symbol definitions (three T) - how could this be? Why did the linker create such a library with a violation ODR? What is the purpose? And why do they all have the same (and weird) address ( 0000000000000000)?
  • How can the same character be both defined ( T) and undefined ( U) at the same time?
+4
source share
1 answer

( , .a) .o ( , .o). undefined , , . nm, . ( -o nm.)

, , , demangle 1 1. libsupc++ :

0000000000000000 T _ZN10__cxxabiv117__class_type_infoD0Ev
0000000000000000 T _ZN10__cxxabiv117__class_type_infoD1Ev
0000000000000000 T _ZN10__cxxabiv117__class_type_infoD2Ev

, ? . gcc Itanium ABI ++,

+3

Source: https://habr.com/ru/post/1606920/


All Articles