NO

Author Topic: No Symbols Added...  (Read 405 times)

Offline PabloMack

  • Member
  • *
  • Posts: 14
No Symbols Added...
« on: March 30, 2020, 03:58:41 pm »
I just assembled a file and got the message:

No symbols added from uo_up.obj; this member will never be seen by the linker.

Strange. I'd linked it before and don't remember this happening. Anyway, I looked
at the file and saw that the "procedure" uo_up had not been declared as PUBLIC.
So I added that and reassembled. Strange that the assembler didn't complain
about the PUBLIC directive but it still thinks that there are no symbols to link in
there. This is the file.

Okay. I just deleted another module that has the same symbol in it and the
message is gone. Apparently the message doesn't indicate the real problem
which should read "symbol multiply defined" which I did get when I tried to
link using the IDE.
« Last Edit: March 30, 2020, 04:11:23 pm by PabloMack »

Offline Vortex

  • Member
  • *
  • Posts: 528
    • http://www.vortex.masmcode.com
Re: No Symbols Added...
« Reply #1 on: April 11, 2020, 03:43:30 pm »
Hello,

You don't need the PUBLIC statement in your procedure. The PROC statement declares your symbol as PUBLIC :

Code: [Select]
;Expression Evaluation Operations
;  Convert up to uo

          .code

;********** Convert up to uo **********
uo_up       proc
            xor     eax,eax

            ;Dst.6~7 = 0
            mov     [rcx+6],ax

            ;Dst.5 = 0
            mov     [rcx+5],al

            ;Dst.4 = Src.4
            mov     al,[rdx+4]
            mov     [rcx+4],al

            ;Dst.0~3 = Src.0~3
            mov     eax,[rdx]
            mov     [rcx],eax

            ;Done
            xor     eax,eax
            ret
uo_up       endp

            end

Code: [Select]
objconv.exe -fmasm uo_up.obj Disasm.txt
Code: [Select]
; Disassembly of file: uo_up.obj
; Sat Apr 11 16:41:54 2020
; Mode: 64 bits
; Syntax: MASM/ML64
; Instruction set: 8086, x64

public uo_up


_text   SEGMENT PARA 'CODE'

uo_up   PROC
        xor     eax, eax
        mov     word ptr [rcx+6H], ax
        mov     byte ptr [rcx+5H], al
        mov     al, byte ptr [rdx+4H]
        mov     byte ptr [rcx+4H], al
        mov     eax, dword ptr [rdx]
        mov     dword ptr [rcx], eax
        xor     eax, eax           
        ret
uo_up   ENDP

_text   ENDS

END
Code it... That's all...

Offline PabloMack

  • Member
  • *
  • Posts: 14
Re: No Symbols Added...
« Reply #2 on: April 16, 2020, 01:44:14 pm »
This makes sense taking into account all of the hard-coded C conventions. Other programming languages don't consider proc's to be public but this package is for supporting C so it makes sense that it would be this way.

Since proc's are automatically public then I would suppose that the key word "static" would make a proc non-pulbic since this is the way C works?