From: Kito Cheng <kito.cheng@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
Andrew Waterman <andrew@sifive.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>,
Binutils <binutils@sourceware.org>,
Nelson Chu <nelson@rivosinc.com>
Subject: Re: RISC-V: attributes and assembly / disassembly
Date: Mon, 12 Sep 2022 21:41:46 +0200 [thread overview]
Message-ID: <CA+yXCZC=mBcBW1Z31DDeMYFHpRaTPiaEEAjFSP8=hsyzaX+T_Q@mail.gmail.com> (raw)
In-Reply-To: <0355e8b2-1ab7-38c8-f3ba-335a25b685bc@suse.com>
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
A quick answer is that should be addressed by mapping symbol, but I am not
sure the current implementation status in binutils side, Nelson might be
able to answer this.
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/196
Jan Beulich via Binutils <binutils@sourceware.org> 於 2022年9月12日 週一 18:14 寫道:
> Hello,
>
> for use in other work I've been playing with this piece of assembly code
>
> .option push
> .option arch, +c
> aliasC:
> sll x1, x1, 3
> c.slli x1, 3
> sra x8, x8, 3
> c.srai x8, 3
> srl x8, x8, 3
> c.srli x8, 3
> .option pop
>
> ending up quite surprised that the resulting object doesn't disassemble
> (at least not without giving the disassembler extra options). It then
> occurred to me to drop the push/pop of the options, and voila - things
> worked. Aiui riscv_write_out_attrs() populates Tag_RISCV_arch with the
> state of things at the end of assembly. Which raises (at least) two
> questions:
>
> 1) Shouldn't the assembler accumulate all extensions which were ever
> enabled in the course of processing the source, and use that set to
> populate Tag_RISCV_arch? Even if that's too simplistic, I don't think
> the state of things at the end of assembly can be taken as
> representative for the entire object.
>
> 2) The assembler properly sets the RVC bit in the ELF flags in the
> case described. Shouldn't the disassembler use that information
> alongside the attributes section?
>
> Thanks for any insight,
> Jan
>
next prev parent reply other threads:[~2022-09-12 19:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 16:13 Jan Beulich
2022-09-12 19:41 ` Kito Cheng [this message]
2022-09-13 2:08 ` Nelson Chu
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='CA+yXCZC=mBcBW1Z31DDeMYFHpRaTPiaEEAjFSP8=hsyzaX+T_Q@mail.gmail.com' \
--to=kito.cheng@gmail.com \
--cc=andrew@sifive.com \
--cc=binutils@sourceware.org \
--cc=jbeulich@suse.com \
--cc=jim.wilson.gcc@gmail.com \
--cc=nelson@rivosinc.com \
--cc=palmer@dabbelt.com \
/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).