This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in generating position independent code with out TEXTREL

Note: This was originally posted on 12th August 2010 at http://forums.arm.com

Hi Experts,

Issue:Not able to remove TEXTREL from our static library generated with --apcs /fpic option using armcc(RVCT 4.0 build 771  tool chain)

Description:
    We compiled our codebase(some modules with handwritten assembly) using armcc(RVCT 4.0 build 771  tool chain) to get static libraries, and then these are used by gstreamer module which further compiles using the above generated libraries with wrappers using GCC tool chain and creates shared objects(.so).

Even though we use equivalent --apcs /fpic compile time option during static library creation to remove position independent code, the TEXTREL are not going from library.
When we disable the (handwritten assembly) in the above mentioned codebase, TEXTRELs go away.
As there are lot of handwritten ARM assembly functions,its difficult to enable one by one and compile and check. :unsure:

So,Experts please throw some light on this issue.


Thanks In Advance,
satish
Parents
  • Note: This was originally posted on 6th January 2011 at http://forums.arm.com

    Sorry, I didn't realize you were using --no_hide_all.  If you're accessing non-hidden symbols then things are more complicated -- more complicated than I understand.  You have to use the GOT (Global Object Table).

    The 'RELOC 96, table_1' is "manually" generating an R_ARM_GOT_PREL relocation at the previous line.  See http://infocenter.ar...b/CIADEEEC.html for a description of the RELOC directive.

    Just adding the RELOC 96 to my embedded asm example is not going to work -- notice how the compiler is using the 'LDR rx, [pc, rx]' (and a different offset in the DCD) instead of 'ADD rx, pc, rx'.

    Details of R_ARM_GOT_PREL are in the BPABI document http://infocenter.ar...037b/index.html.

    Good luck.
Reply
  • Note: This was originally posted on 6th January 2011 at http://forums.arm.com

    Sorry, I didn't realize you were using --no_hide_all.  If you're accessing non-hidden symbols then things are more complicated -- more complicated than I understand.  You have to use the GOT (Global Object Table).

    The 'RELOC 96, table_1' is "manually" generating an R_ARM_GOT_PREL relocation at the previous line.  See http://infocenter.ar...b/CIADEEEC.html for a description of the RELOC directive.

    Just adding the RELOC 96 to my embedded asm example is not going to work -- notice how the compiler is using the 'LDR rx, [pc, rx]' (and a different offset in the DCD) instead of 'ADD rx, pc, rx'.

    Details of R_ARM_GOT_PREL are in the BPABI document http://infocenter.ar...037b/index.html.

    Good luck.
Children
No data