public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alex Matveev <alex.matveev@samsung.com>
To: binutils@sourceware.org
Subject: ARM position-independent code in Gas
Date: Wed, 26 Feb 2014 20:02:00 -0000	[thread overview]
Message-ID: <20140227000201.42c81571@amatveev> (raw)

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.

             reply	other threads:[~2014-02-26 20:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 20:02 Alex Matveev [this message]
2014-02-27  3:45 ` Matt Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140227000201.42c81571@amatveev \
    --to=alex.matveev@samsung.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).