vtable with PIC option
HI,
we are looking to get our code position independant on cortex-m4.
I have activated those switches, -fPIC -mno-pic-
The question is about vtable/typeinfo. I see in my map file that all the vtable now get into a new section (compare to no pic option) called .data. rel.ro instead of .rodata
I know that in a full os like Linux, this can be interesting, but for an bare metal system, this is look strange to me. The vtable cannot change in runtime, so I think this vtable should confsidered like any other const symbol and continue to be text relative (from PC) like any other function.
The main issue here, is that each vtable, are now referenced by the GOT and in the mean time add code to retrieve the VTABLE.
From a small measurement, this add ~ 5% more code on big project.
Are you aware of any compiler switch for VTABLE/TYPEINFO to be PC relative instead of be referenced into the GOT ?
Regards
Jonathan
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: