[Libre-soc-dev] Simulator does not like labels?

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed May 19 16:11:29 BST 2021


On Wed, May 19, 2021 at 3:13 PM Lauri Kasanen <cand at gmx.com> wrote:

> You say it already calls as, ld and objdump. That means it should
> already work with labels.
>

it's complicated, and it doesn't (and i'm not going to add it to the
infrastructure) - it's an inappropriate location based on the fact that the
assembly listings are passed in and matched up line-for-line with their
corresponding binary opcode, based on python lists.

this matching process is not capable of understanding labels or any other
syntax *other* than "raw assembler", and it's far too complicated and
inappropriate to add.

there *is* however an option where "pure binaries" can be passed in
(without any corresponding python-based assembly listing, which is set to
"empty list"), and *this* mode is the one that can be exploited by the
5-stage steps i outlined.

thus, *externally* you can create a Makefile that uses gnu-as, at which
point labels are perfectly possible.

to summarise, then: it is down to the internal reporting, and it is
inappropriate and unnecessary to modify the simulator and assembly listing
processing to "understand" labels.

i didn't answer the question directly because the discrepancy you spotted
(expected functionality) is not something i am going to add.  other people
can put forward patches in the future if they want to: i'm not going to
focus on it, instead will provide you with the means to follow those 5
steps.

l.


More information about the Libre-soc-dev mailing list