public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Help: 'unresolved expression that must be resolved'
@ 2002-09-30  7:22 Michael Chapman
  2002-09-30  7:27 ` Frank Ch. Eigler
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Chapman @ 2002-09-30  7:22 UTC (permalink / raw)
  To: cgen

I have trouble trying to refer to a label in the assembler 
anywhere.

The one line test program

	subroutine: call subroutine

gives me

$ gas test1.asm
test1.asm: Assembler messages:
test1.asm:1: Error: unresolved expression that must be resolved
$ 

What does it mean that an expression is unresolved?

Here below is the relevant parts from my .cpu file.

Any explanations as to how to make this simple example work
would be most welcome.

Thanks.
Mike Chapman


; Opcode fields
(dnf f-call-opcode "call opcode" () 7 6)

; Absolute address, 26-bit (shifted 1 bit to right)
(df f-abs26   "abs26"  (ABS-ADDR) 
    31 26 UINT
    ((value pc) (sra WI value (const 1)))
    ((value pc) (sll WI value (const 1))))

; Instruction operands.
(dnop abs26  "abs26"         ()       h-iaddr f-abs26)

; Instructions
(dni call-abs26 "call abs26"
     (UNCOND-CTI)
     "call $abs26"
     (+ (f-call-opcode #xf3) abs26)
     (set pc abs26)
     ()
)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: 'unresolved expression that must be resolved'
  2002-09-30  7:22 Help: 'unresolved expression that must be resolved' Michael Chapman
@ 2002-09-30  7:27 ` Frank Ch. Eigler
  2002-09-30  7:54   ` Michael Chapman
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Ch. Eigler @ 2002-09-30  7:27 UTC (permalink / raw)
  To: Michael Chapman; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Hi -

On Mon, Sep 30, 2002 at 04:21:59PM +0200, Michael Chapman wrote:
> [...]
> The one line test program
> 
> 	subroutine: call subroutine
> 
> gives me
> 
> $ gas test1.asm
> test1.asm: Assembler messages:
> test1.asm:1: Error: unresolved expression that must be resolved
> $ 
> What does it mean that an expression is unresolved?

It means that the assembler can neither emit a literal value for
the expression (the address of the "subroutine" symbol), nor does
it have an available relocation type so that the linker can fill
in a value.  If the operand was declared as PC-relative (see
PCREL-ADDR), the assembler would be able to resolve the value at
assembly time (probably -2 or something like that).


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Help: 'unresolved expression that must be resolved'
  2002-09-30  7:27 ` Frank Ch. Eigler
@ 2002-09-30  7:54   ` Michael Chapman
  2002-09-30  8:04     ` Frank Ch. Eigler
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Chapman @ 2002-09-30  7:54 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

Hi again,

So how do I get a relocation type in their?
Mike


-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: Monday, 30 September, 2002 16:27
To: Michael Chapman
Cc: cgen@sources.redhat.com
Subject: Re: Help: 'unresolved expression that must be resolved'


Hi -

On Mon, Sep 30, 2002 at 04:21:59PM +0200, Michael Chapman wrote:
> [...]
> The one line test program
> 
> 	subroutine: call subroutine
> 
> gives me
> 
> $ gas test1.asm
> test1.asm: Assembler messages:
> test1.asm:1: Error: unresolved expression that must be resolved
> $ 
> What does it mean that an expression is unresolved?

It means that the assembler can neither emit a literal value for
the expression (the address of the "subroutine" symbol), nor does
it have an available relocation type so that the linker can fill
in a value.  If the operand was declared as PC-relative (see
PCREL-ADDR), the assembler would be able to resolve the value at
assembly time (probably -2 or something like that).


- FChE

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: 'unresolved expression that must be resolved'
  2002-09-30  7:54   ` Michael Chapman
@ 2002-09-30  8:04     ` Frank Ch. Eigler
  2002-09-30  8:41       ` Michael Chapman
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Ch. Eigler @ 2002-09-30  8:04 UTC (permalink / raw)
  To: Michael Chapman; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

Hi -

On Mon, Sep 30, 2002 at 04:54:03PM +0200, Michael Chapman wrote:
> So how do I get a relocation type in their?

You need to do some gas/bfd hacking outside cgen's purview.
See gas/config/tc-TARGET, bfd/elf*-TARGET, include/elf/TARGET*,
etc.  All hand-made, I'm afraid.


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Help: 'unresolved expression that must be resolved'
  2002-09-30  8:04     ` Frank Ch. Eigler
@ 2002-09-30  8:41       ` Michael Chapman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chapman @ 2002-09-30  8:41 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

Hi,

Thanks. It was the gas/config/tc-TARGET I had forgotten all 
about. I see kind of how that adds up now.

Lets see if I can make that work.

Thanks for your help.

Mike


-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: Monday, 30 September, 2002 17:04
To: Michael Chapman
Cc: cgen@sources.redhat.com
Subject: Re: Help: 'unresolved expression that must be resolved'


Hi -

On Mon, Sep 30, 2002 at 04:54:03PM +0200, Michael Chapman wrote:
> So how do I get a relocation type in their?

You need to do some gas/bfd hacking outside cgen's purview.
See gas/config/tc-TARGET, bfd/elf*-TARGET, include/elf/TARGET*,
etc.  All hand-made, I'm afraid.


- FChE

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-30 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-30  7:22 Help: 'unresolved expression that must be resolved' Michael Chapman
2002-09-30  7:27 ` Frank Ch. Eigler
2002-09-30  7:54   ` Michael Chapman
2002-09-30  8:04     ` Frank Ch. Eigler
2002-09-30  8:41       ` Michael Chapman

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).