eliminate unused virtual functions

前端 未结 2 941
执念已碎
执念已碎 2020-12-19 22:39

To eliminate unused (ordinary) function I can use: -ffunction-sections, -fdata-section and --gc-sections. and it works.

I know that using polymorphism, function are

2条回答
  •  伪装坚强ぢ
    2020-12-19 23:30

    Thanks to Jonathan Wakely I started digging and I found gcc options:

    -fvtable-gc Emit special relocations for vtables and virtual function references so that the linker can identify unused virtual functions and zero out vtable slots that refer to them. This is most useful with -ffunction-sections and -Wl,--gc-sections, in order to also discard the functions themselves.

    But it is not supported in GCCv4.7.1

提交回复
热议问题