• Re: cc/lis/machine on OpenVMS x86_64 Operating System, Version V9.2-3; no machine code????

    From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Mon Sep 1 19:59:27 2025
    From Newsgroup: comp.os.vms

    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajh|+j wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Mon Sep 1 18:52:34 2025
    From Newsgroup: comp.os.vms

    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajh|+j wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From John Reagan@johnrreagan@earthlink.net to comp.os.vms on Tue Sep 2 12:49:30 2025
    From Newsgroup: comp.os.vms

    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajh|+j wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...


    The Alpha/Itanium compilers support /LIST/MACHINE. [The Itanium C++ uses ANAL/OBJ/DISASSEMBLE behind the scenes]. For x86, hacking LLVM to do
    BOTH an object file and a machine code listing is awkward. For x86
    compilers only, you can also say /SWITCH=ASSEMBLY and get an .S file and
    not an OBJ file. Most of the time the S file should work with llvm-mc,
    but all of the time [which is why we don't document it - long story]

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Tue Sep 2 16:05:09 2025
    From Newsgroup: comp.os.vms

    On 9/2/2025 6:07 AM, hb0815 wrote:
    On 9/2/25 00:52, Arne Vajh|+j wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***-a This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.-a OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    If you really need to see the machine code that is in an object file,
    for which you don't have the source code ...

    DEC did not provide a disassembler.

    But at least for VAX other did:

    https://www.digiater.nl/openvms/freeware/v80/dism32/

    worked pretty well as I remember it.

    But Alpha is a different story.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Tue Sep 2 23:53:50 2025
    From Newsgroup: comp.os.vms

    hb0815 <mw40171@mucweb.de> wrote:
    On 9/2/25 00:52, Arne Vajh|+j wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***-a This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.-a OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    objdump can disassemble, just use 'objdump -d' (or 'objdump -D' is you
    expect code in nominally non-code sections). Works for me
    with Alpha VMS .obj files (and executables). My main use is to check potentially confusing assembler mnemonics (which encoding is used
    by the assembler).
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From hb0815@mw40171@mucweb.de to comp.os.vms on Tue Sep 2 12:07:36 2025
    From Newsgroup: comp.os.vms

    On 9/2/25 00:52, Arne Vajh|+j wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***-a This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.-a OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    If you really need to see the machine code that is in an object file,
    for which you don't have the source code ...

    In an own program, you can read the code psect(s) of the object
    module(s) into memory and start the debugger (remember the ZAP tool?) to disassemble it

    There is also SRM_CHECK. It can disassemble code sections in Alpha
    images. But that was not the main purpose of this tool. So I don't know
    how good the disassembly output really is. However it's available as
    freeware and the ZIP archive contains the source code.

    And yes, ANALYZE/DISASSEMBLE (/OBJECT is default) is only for ELF
    (Executable and Linkable Format) objects. There was obviously a need for
    this and adding a disassembler to a tool that already knew the format of
    the object module was the preferred solution.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Thu Sep 4 12:22:57 2025
    From Newsgroup: comp.os.vms

    On 2025-09-02, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 9/2/2025 6:07 AM, hb0815 wrote:

    This indicates, that for (VAX and) Alpha nobody saw the need for a
    disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of
    knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    If you really need to see the machine code that is in an object file,
    for which you don't have the source code ...

    DEC did not provide a disassembler.


    [snip]

    But Alpha is a different story.


    What about srm_check ? It apparently has an undocumented disassembler
    built into it.

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From hb0815@mw40171@mucweb.de to comp.os.vms on Thu Sep 4 18:33:04 2025
    From Newsgroup: comp.os.vms

    On 9/4/25 14:22, Simon Clubley wrote:

    What about srm_check ? It apparently has an undocumented disassembler
    built into it.

    As mentioned previously, srm_check only works with image files - for
    obvious reasons.

    If you really want to use it, the best you can do is to link your object module(s) with /NOREPLACE, exclude any default library and shareable
    image, ignore all the warnings about undefined symbols and hope that the linker generates an image file.

    Also, if you search for "srm_check," you may find complaints about the disassembly output not always being correct. I don't know if this was fixed. --- Synchronet 3.21a-Linux NewsLink 1.2