new gas directives with precise control over endian & size

Mike Frysinger vapier@gentoo.org
Thu Jan 14 03:02:09 GMT 2021


On 14 Jan 2021 12:18, Alan Modra via Binutils wrote:
> On Wed, Jan 13, 2021 at 07:05:08PM -0500, Mike Frysinger via Binutils wrote:
> > tl;dr: i want gas directives with precise size/endian control for data
> > 
> > i have a situation where i need to embed some little endian data, and
> > always use little endian regardless of the target's endianness.  i'm a
> > little (but not much tbh) surprised by gas's limited directives.
> 
> I'd be choosing a well supported gas target that already does
> little-endian and assemble your object file using that target.

i'm specifically building example code to work with both.  i have it
working on little endian targets already, but noticed this issue as i
went to polish it for release.

> [snip]
> > somewhat related, should we promote the ELF .[248]byte directives to
> > work for all targets ?  there's nothing ELF specific with them ...
> > they call the same exact common code as e.g. .short.  that would give
> > us precise size control while being target endian dependent.
> 
> Yes, I've thought about doing this myself.

OK, i'll post a patch for it

> > any thoughts/feedback before i actually implement this ?
> 
> Fixups in gas are going to be a problem, unless you only allow
> expressions that can be resolved at the point they appear.

sure, but .byte/.word/etc... already have that problem right ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20210113/ef6c2aeb/attachment.sig>


More information about the Binutils mailing list