Skip to contentSkip to conversation

rela sections in vmlinux

DISCUSSION Ruslan Kuprieiev 1 participant 2 messages Mar 6, 2016 – Mar 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi!

I'm trying to figure out how CONFIG_RELOCATABLE works and one of the things that I've noticed is that vmlinux itself doesn't have any rela sections, which is confusing for me considering the name of the option. I did read the patches that introduced this option but it is still not clear to me how exactly it works and why there are no relocations left in the vmlinux. Could you please give me a hint on why it happens and point me where to read more?

I also see that vmlinux.o has all the rela sections I'm looking for(as an object file should =)), so it raises another question: Is it possible to make vmlinux keep that rela sections? I also went through makefiles but couldn't figure out where to make a proper change to achieve that.

I'm using default 3.10.0-229.20.1.el7.x86_64 centos7 kernel with CONFIG_RELOCATABLE enabled.

Thanks,
Ruslan

#1 lore raw

Hi All,

Just wanted to answer my own question.

The problem was that I forgot to add --emit-relocs to my own script and that's why I didn't find any rela sections in vmlinux. After adding proper ld options everything started to make sense =).

Thanks,
Ruslan

Quoted 19 lines · Ruslan Kuprieiev

Hi!

I'm trying to figure out how CONFIG_RELOCATABLE works and one of the things that I've noticed is that vmlinux itself doesn't have any rela sections, which is confusing for me considering the name of the option. I did read the patches that introduced this option but it is still not clear to me how exactly it works and why there are no relocations left in the vmlinux. Could you please give me a hint on why it happens and point me where to read more?

I also see that vmlinux.o has all the rela sections I'm looking for(as an object file should =)), so it raises another question: Is it possible to make vmlinux keep that rela sections? I also went through makefiles but couldn't figure out where to make a proper change to achieve that.

I'm using default 3.10.0-229.20.1.el7.x86_64 centos7 kernel with CONFIG_RELOCATABLE enabled.

Thanks,
Ruslan