vtable with PIC option

Asked by Jonathan Dumaresq

HI,

we are looking to get our code position independant on cortex-m4.

I have activated those switches, -fPIC -mno-pic-data-is-text-relative -msingle-pic-base. Now with this code, I see in assembly, that the compiler will use the R9 to locate the GOT and get ossfet in to the to reach global symbol. In global symbol, I see global variables, static variable and vtable/typeinfo.

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
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jonathan Dumaresq (jdumaresq) said :
#1

Hi,

any though ?

Regards

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Jonathan Dumaresq (jdumaresq) said :
#3

Hi,

any though ?

Regards

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.