Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

NIOS II relocation types

Hi, I am a student and I am doing my diploma work at the moment. It is about loading elf file on a NIOS II board - I have problems with the relocation that is done as part of the loading of an elf file - for instance I dont know the relocation types and what are the rules for relocation in each different relocation type - I suppose I need some special dosumentation which I am not able to find at this exact moment - Thank you in advance for your help!

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi dimo,

    > I have problems with the relocation that is done as part of the loading of an elf file

    What problems are you having?

    > for instance I dont know the relocation types

    If you use nios2-download, you don't need to know anything about elf relocation types.

    Or are you writing your own loader?

    > I suppose I need some special dosumentation which I am not able to find at this

    > exact moment

    Try: http://www.cs.princeton.edu/courses/archiv...reading/elf.pdf (http://www.cs.princeton.edu/courses/archive/fall05/cos217/reading/elf.pdf)

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, Scott - yes I am writing my own elf loader - the pdf that you sent me was my main source of information - My problem is that I dont know the rules that applies for the different reltypes in Nios Architecture.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi dimo,

    > I dont know the rules that applies for the different reltypes in Nios Architecture.

    Sorry I can't be of more help here -- I'm not sure where you can get the details

    you're looking for ... other than by digging into the binutils code.

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi dimo,

    we developed our ELF bootloader with the exact same spec

    that Scott provided. Originally for a different soft-core but

    it works for NIOS II as well.

    Our loader relocates all sections with the type that has SHT_PROGBITS

    and SHF_ALLOC flag set.

    To save some space you can run your ELF trough strip first,

    but not required.

    Cheers, Roger
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by rsteiner@Feb 9 2006, 07:37 AM

    hi dimo,

    we developed our elf bootloader with the exact same spec

    that scott provided. originally for a different soft-core but

    it works for nios ii as well.

    our loader relocates all sections with the type that has sht_progbits

    and shf_alloc flag set.

    to save some space you can run your elf trough strip first,

    but not required.

    cheers, roger

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12655)

    --- quote end ---

    --- Quote End ---

    http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif