I tested to the extent to which I understand your situation, with cross-gcc (i.e. gcc-c++-arm-linux-gnu) on x64 CentOS, gcc 4.8.5, binutils 2.27.
test.cpp (return type is just to coerce an access):
Code:
struct kernel_info
{
const char* name = "MinOS";
const char* version = "0.1";
const char* build = "1";
} kernel_info;
extern "C" int _start()
{
return kernel_info.name[0];
}
The assembly and GOT results are on
pastebin here, but basically the code uses GOT in the intermediate object files and the final elf. Also, the GOT is populated with the correct address and there are no outstanding relocations. My assembly comprehension on arm is poor, so you may make better sense out of it, but it seems correct.
Something must differ in your setup. Obviously the gcc build, but may be also the cpu target ("cortex-a5" in my case), or the usage, etc.
Edit: changed the paste to the bash commands that are relevant