News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

OBJ file exposes itself path

Started by bluedevil, October 07, 2022, 07:49:19 AM

Previous topic - Next topic

bluedevil

Quote from: zedd151 on October 07, 2022, 06:56:34 PM
Have you tried using poasm rather than ml64 to create the .obj files...?
From here, doesnt add the path to the object files.

Are you sure, because I couldn't. Can you share which parameters you used to assemble with poasm?
..Dreams make the future
But the past never lies..
BlueDeviL // SCT
My Code Site:
BlueDeviL Github

hutch--

Hi bluedevil,

I have attached a simple console example that calls a couple of MASM64 library modules. They can be found in the OBJ module but do not appear in the EXE file. When you mention a STATIC library, that is a different matter, a library contains the data in the OBJ modules so it will be visible in a HEX editor.

I have never done it but you could try in the final library to replace the path with blanks so it cannot be read.

TimoVJL

Just testing:

SUBST X: working folder
X:
ml64 foo.asm

in debug$S SECTION is X:foo.obj
May the source be with you

zedd151

Quote from: bluedevil on October 07, 2022, 07:04:18 PM
Quote from: zedd151 on October 07, 2022, 06:56:34 PM
Have you tried using poasm rather than ml64 to create the .obj files...?
From here, doesnt add the path to the object files.

Are you sure, because I couldn't. Can you share which parameters you used to assemble with poasm?

Didnt work here either, I tried it then revised that post.

but this is what I used..

\masm64\bin64\poasm.exe _add.asm
\masm64\bin64\poasm.exe _sub.asm


\masm64\bin64\lib.EXE _add.obj _sub.obj /out:test.lib


But when linking test code to the .lib file, it doesnt work... the test program crashed, I don't have debugger for 64 bits. So couldn't check why it crashed
I dont know what parameters poasm needs as I am unfamiliar with it, but it didnt like '/c' so I removed that

The first solution that I offered seems to be the best I can come up with, manually zeroing out the path string in the object files.
I'm still learning some of this stuff myself.  :biggrin:

bluedevil

Quote from: TimoVJL on October 07, 2022, 07:06:51 PM
Just testing:

SUBST X: working folder
X:
ml64 foo.asm

in debug$S SECTION is X:foo.obj

@TimoVJL thank you very much. You trick is awesome. So I only change my batch file and now there is no path info in both obj files and in the static lib file.

REM Clean command prompt screen
cls

set appname=ArithLib

REM Substitute working folder
subst Y: %cd%
Y:

REM Delete compiled files if exists
if exist %appname%.lib del %appname%.lib
if exist %appname%.res del %appname%.res
if exist %appname%.obj del %appname%.obj

REM Assemble
C:\masm64\bin64\ml64.exe /c Modules\_add.asm
C:\masm64\bin64\ml64.exe /c Modules\_sub.asm

REM Compile object files into lib
C:\masm64\bin64\LIB.EXE *.obj /out:%appname%.lib

dir %appname%.lib

REM Delete virtual drive
C:
subst Y: /D


pause


Even though my aim was to to this by adding "some" parameters to ml64 or lib.exe, I now see that this is not possible!

@zedd151 and @hutch-- guys poasm and polib makes reaaaaaally small files/ I loved that!

I have included the sources and edited batch files for both ml64 and poasm

let me celebrate this  :eusa_dance: :cool:
..Dreams make the future
But the past never lies..
BlueDeviL // SCT
My Code Site:
BlueDeviL Github

zedd151

Okay, great! Glad you have the issue reolved. I wasn't so sure about poasm as I have never used it, but knew it didnt add the path strings.
My test program crashed though after using a lib created via poasm/lib. As long as you have got it working though, its all good.  :biggrin:

bluedevil

Quote from: zedd151 on October 07, 2022, 08:12:59 PM
Okay, great! Glad you have the issue reolved. I wasn't so sure about poasm as I have never used it, but knew it didnt add the path strings.
My test program crashed though after using a lib created via poasm/lib. As long as you have got it working though, its all good.  :biggrin:

Static library is not working if I create with poasm and polib. But it is not important right now; beacuse my aim is to use MASM64 SDK. And the library which I created with MASM64 SDK is working  :thumbsup:
..Dreams make the future
But the past never lies..
BlueDeviL // SCT
My Code Site:
BlueDeviL Github

zedd151

Okay. I am very glad that you have found a solution that works for you, for the path issue.   :biggrin:

HSE

For example put _add.asm and _sub.asm in ArithLib directory, not in a subdirectory.
Equations in Assembly: SmplMath

bluedevil

Quote from: HSE on October 07, 2022, 10:19:01 PM
For example put _add.asm and _sub.asm in ArithLib directory, not in a subdirectory.

Unfortunately there is no difference. ML64.exe assembles the source with the path of the file, so interesting. And I couldn't find any parameters to override this!
..Dreams make the future
But the past never lies..
BlueDeviL // SCT
My Code Site:
BlueDeviL Github