title: How to generate location independent code using GNU ARM toolchain?
body: <p>I am using ARM ELF toolchain for my project. I am working on a bootloader which needs to be location independent as it will relocate it self from flash to ram upon reset. I have tried hard to figure out how to compile location independent code using GNU ARM toolchain but can not seem to make it work. </p>
  
  <p>I have tried using -fpic and -fpie options for the compiler and -pie for linker but when I use these options the compiler complains that no section is defined for either .got or .plt sections. I am not sure where these sections should go i.e in BSS or TEXT. After googling about this, I think I should only use -fpie but I am not sure.</p>
  
  <p>Can someone with experience with this please help me. I am using GNU ARM 4.1.1</p>