This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ARM position-independent code in Gas


Hello all,

I'm working on a project which is part C and part assembler (ARM, GCC
4.8.2, binutils 2.23.1), and final binary should be
position-independent.

I compile stuff with -fpie and link with -pie -fpie. This works out
fine on the C side - I get R_ARM_RELATIVE and R_ARM_ABS32 relocations,
fix'em up on startup, all good. But the problem is, there are no relocs
from assembler objects, thus the result is not PIC. Trying to trick Gas
into producing relocs, I've found couple of
not-very-extensively-documented directives - '.reloc' and ARM-specific
'.word foo(RELOC)', but I haven't had any success with them either.

Can GAS in principle produce PIC? Or am I missing something obvious?

And a side question: I'm somewhat puzzled by the presence of
R_ARM_ABS32 relocations in the final output - aren't they static
(AAELF says so)?

Thanks.

-- 
Alex Matveev
Samsung R&D Institute Rus.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]