[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1705210354330.2590@tp.orcam.me.uk>
Date: Sun, 21 May 2017 04:22:45 +0100
From: "Maciej W. Rozycki" <macro@...tec.com>
To: David Miller <davem@...emloft.net>
CC: <ast@...com>, <daniel@...earbox.net>, <netdev@...r.kernel.org>
Subject: Re: BPF relocations
On Fri, 12 May 2017, David Miller wrote:
> Internally, we have to emit some kind of relocation as GAS makes it's
> first pass over the instructions.
Not really, you can defer that until the relaxation pass, e.g. to avoid
figuring out what to do about forward local symbol references, especially
in complex expressions that may eventually resolve to assembly constants.
This is how MIPS16 assembly works for example, due to its dual regular vs
extended instruction encoding, so that no artificial relocations had to be
invented in GAS for the regular instructions, which never get relocations
recorded against in an object file. Any instruction that ends up needing
a relocation, if supported (not all encodings do), gets converted to the
extended form in the relaxation pass and only then a suitable fixup is
attached to it.
Of course that may not matter for your specific case, but I think it's
worth noting so as to avoid people getting misled about how GAS works.
FWIW,
Maciej
Powered by blists - more mailing lists