Re: JWasm v1.9 - now 1.91!!!



japheth wrote:
A quick look at the output of "objdump -d" doesn't show any obvious
problem - we seem to be doing the same thing, albeit "arranged" a little
differently - I call "drawstring" as a subroutine... One oddity, I
noticed: my calls look like "call xxxxxxxx <X...@plt>", and yours all
add "+0x4". Whazzup with that???

That's indeed very strange. Seems like the relocations are wrong. With
Agner Fog's OBJCONV,

That's quite a cool thing! "Scattered" as I am, I haven't actually used it on the present problem. I got distracted by the "-fasm" switch - using it (scattered as I am) on Herbert's C-translation of "Annie's Heart". It produced what looked, at first glance, like re-assembleable code! Not Nasm syntax, of course, not Fasm, despite the name of the switch, but Masm (looks like). I wondered if Jwasm would assemble it, and just now tried it. Segfault! I wasn't sure I had the lastest version... I see there's a brand new one. Let me announce it for ya. Jwasm v 1.91 is available!

http://www.japheth.de/JWasm.html

Still segfaults, though. :(

So I guess this is a "bug report", of sorts. I can provide the exact code it fails on, if you want. (just objconv -fasm herbert's thingie) Gdb says it fails at 0x806f6e9 in __fprtf_(), if that helps...

if I dump JWasm's object module, there is:

------------------------------------------------------
Relocations:
Offset: 0x3, Symbol: 12, Name: XOpenDisplay
Type: Self-relative 32 bit
Offset: 0x1A, Symbol: 5, Name: StringOpenFailed
Type: Absolute 32 bit
Offset: 0x2B, Symbol: 6, Name: Display
Type: Absolute 32 bit
Offset: 0x31, Symbol: 6, Name: Display
Type: Absolute 32 bit
Offset: 0x36, Symbol: 13, Name: XDefaultRootWindow
Type: Self-relative 32 bit
------------------------------------------------------

while output of Nasm's module is:

------------------------------------------------------
Offset: 0x1C, Symbol: 26, Name: XOpenDisplay
Type: Self-relative 32 bit, Inline addend: -4
Offset: 0x2B, Symbol: 3, Name:
Type: Absolute 32 bit
Offset: 0x31, Symbol: 3, Name:
Type: Absolute 32 bit
Offset: 0x36, Symbol: 27, Name: XDefaultRootWindow
Type: Self-relative 32 bit, Inline addend: -4
Offset: 0x66, Symbol: 3, Name:
Type: Absolute 32 bit
------------------------------------------------------

I'll get back to this... I don't know what "normal" is, at this point...

But, with wrong relocs the JWasm binary shouldn't run at all, should
it?

Not if it were actually "wrong", I wouldn't think. I think there's a couple of ways to do this, possibly analogous to "call ExitProcess" vs "call [__imp_ExitProcess]" in Windows(???). I vaguely recall doing something like...

mov eax, [Xthing + 4]
call [eax]

I can't quite recall what it was... I thought it might be "better"... eliminated a "jmp [???]" or something (IIRC). I was advised that it would probably be slower, not being predicted as well, so I abandoned the idea... and lost the source in a "partition mishap" (maybe I can recover it still...). Or may be I can re-figure-out what I did. I think what Jwasm's doing may be "legitimate".

It runs on my machine, however, I see the text in the expected
colors and pressing a key terminates the program.

The fact that I see different colors isn't a surprise - I think I "got lucky" - I don't think that color routine is right - works with some cards, not others, I suspect...

The fact that pressing a key does *not* terminate on my machine is more of a surprise, and more disturbing! Perhaps that "off by four" difference explains it, but it doesn't seem "likely" to me - since everything else *does* seem to work as expected. I can't think what *else* it could be...

I'll get back to this. I'm still in my "lazy hole". Getting some wood split and stacked, so it isn't a total loss, but no asm... I haven't forgotten! Just wanted to congratulate you on the release of 1.91! :)

Best,
Frank


.



Relevant Pages

  • Re: MATCH() Function and Blanks
    ... Either relative or absolute will work for me as I can OFFSET() from either ... Assuming there is only one empty cell. ... I would use the array formula: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: disassembling memory when a MTP is running.
    ... > How can one dump memory from a absolute address upto an offset, ...
    (comp.os.linux.development.apps)
  • Re: JWasm v1.9
    ... Offset: 0x1A, Symbol: 5, Name: StringOpenFailed ... Type: Absolute 32 bit ... Offset: 0x2B, Symbol: 6, Name: Display ... Offset: 0x36, Symbol: 13, Name: XDefaultRootWindow ...
    (alt.lang.asm)
  • Re: [RFC 00/15] x86_64: Optimize percpu accesses
    ... It doesn't matter if it's rip-relative. ... Small absolute addresses generate exactly the same form as large absolute addresses. ... It has no effect on how you compute your offset. ... The addressing modes: ...
    (Linux-Kernel)