RE: .gnu.linkonce.? and .gcc_except_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

The linkonce is to support C++ vague linkage.  It is related to C++'s ODR, and can cause surprises if ODR is violated.

> Is there an example, perhaps, that will cause this illusive link once section to appear in an object file?

If you compile with RTTI turned on, you'll see linkonce sections for all the RTTI of all the classes in the translation unit of that object file.

If you keep generated functions for inline functions (-fkeep-inline-functions), I presume you'll see linkonce sections for all the emitted kept inline functions.

(Since, typically, inline functions are in header files, this would be a violation of the principle that header files do not emit code (.text) or data (.data, .bss) into object files.  RTTI information emitted is fuzzy, and doesn't count against the principle.)

> Do they actually appear in C programs?

I am not aware of C programs using linkonce, since it's for linker support for C++ vague linkage semantics.

Perhaps used for C static inline functions in header files.  (C99)

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux