flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > "invalid use of symbol" v1.71.05

Author
Thread Post new topic Reply to topic
yoshimitsu



Joined: 07 Jul 2011
Posts: 96
yoshimitsu 22 Nov 2012, 10:17
Hello,
I got some problems with the error mentioned in the title when having relocations generated.
With version 1.69.52 the following code still worked:
Code:
format PE GUI
entry start

include 'win32a.inc'

section '.code' code readable executable

  start:
        lea     eax,[data_stuff-start]          ; works
        lea     eax,[data_stuff-.other_label]   ; works
        add     eax,data_stuff-start            ; works
  .other_label:
        push    0
        call    [ExitProcess]

  data_stuff:

section '.data' data readable writeable

  rd 1

section '.idata' import data readable

  library kernel32,'KERNEL32.DLL'

  import kernel32,\
         ExitProcess,'ExitProcess'

section '.reloc' fixups data readable discardable    


with version 1.71.05 it looks like this:
Code:
        lea     eax,[data_stuff-start]          ; invalid use of symbol
        lea     eax,[data_stuff-.other_label]   ; works
        add     eax,data_stuff-start            ; works    


And another question regarding relocatable addresses:
is a virtual-directive evaluated directly or when used?
because since v1.71.02 the difference between two relocatable addresses can be calculated by first subtracting, then adding, so I tried the following which sadly doesn't work:
Code:
  start:
        virtual at eax-data_stuff               ; invalid use of symbol
        .x:
        end virtual

        lea eax,[.x+.other_label]

  .other_label:
        push    0
        call    [ExitProcess]

  data_stuff:    
Post 22 Nov 2012, 10:17
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 22 Nov 2012, 11:36
Thank you reporting. I have prepared 1.71.06 release which addresses both issues.
Post 22 Nov 2012, 11:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.