This is the mail archive of the 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]

Re: Specify architecture for SPARC gas tests

Hi Jose,

> In GNU/Linux GAS annotates the hardware capabilities when it assembles
> an ELF object.  From gas/config/tc-sparc.c:sparc_md_end:
> #if defined(OBJ_ELF) && !defined(TE_SOLARIS)
>   hwcaps = hwcap_seen & U0xffffffff;
>   hwcaps2 = hwcap_seen >> 32;
>   if (hwcaps)
>     bfd_elf_add_obj_attr_int (stdoutput, OBJ_ATTR_GNU, Tag_GNU_Sparc_HWCAPS, hwcaps);
>   if (hwcaps2)
>     bfd_elf_add_obj_attr_int (stdoutput, OBJ_ATTR_GNU, Tag_GNU_Sparc_HWCAPS2, hwcaps2);
> #endif
> Then when BFD opens the file, it looks at the GNU object attributes
> HWCAPS and HWCAPS2 and determines the opcodes architecture that is
> subsequently used by the disassembler.  See
> bfd/elfxx-spac.c:_bfd_sparc_elf_object_p.

ah, that's the missing piece: I'd already wondered how those failures
could have escaped you.

> The hwcaps tags are not created in Solaris though, so that's why the
> tests are failing...  I wonder if it is possible to change the tests so
> they use -msparc:MACH only when testing in solaris targets?

I've no idea, but there's already tcl code that modifies/rewrites tags
in the *.?d files.  That could certainly be extended...

> Alternatively, I guess we could just change the assembler to add the GNU
> object attributes also in solaris...

TBH, I'd rather not, given that Solaris has a native format for this

I'd long meant to implement this in binutils.


Rainer Orth, Center for Biotechnology, Bielefeld University

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