ALink with DJGPP and NAsm? 
Author Message
 ALink with DJGPP and NAsm?

I'm using djgpp+nasm to write programs, and I used to use the linking
capabilities of gcc (well, it really calls ld). Now I'm trying to start
using ALink, but I have some problems.

The problem is that when I compile a program with

gcc -c program.c -o program.o

and then I do

alink program.o -o program.exe

I get a lot of errors (unresolved external ___main and similars). Then, I
tried the same thing but with ld, and it gave me the same errors, so I
searched for other options. Finally, I found that the correct command-
line was:

ld program.o c:\util\djgpp\lib\crt0.o c:\util\djgpp\lib\libc.a
c:\util\djgpp\lib\libgcc.a -o program.exe

and it worked.

But the problem went when I tried the same with alink and it gave me the
following error:

ALINK v1.6 (C) Copyright 1998-9 Anthony
All Rights Reserved

Loading file hola.o
Loading file c:\util\djgpp\lib\crt0.o
Loading file c:\util\djgpp\lib\libc.a
961 symbols
Loaded first linker member
Loading file c:\util\djgpp\lib\libgcc.a
81 symbols
Loaded first linker member
Loading module _main.o/
Loading module printf.o/
Loading module crt1.o/
Loading module exceptn.o/
.....
Loading module _udivdi3.o/
Loading module modfl.o/
Error, Insufficient memory in call to malloc

This seems a very strange error, since I suppose that it would be
possible to use alink to link a djgpp program. So, I think that I'm doing
something wrong.

If any of you can help me, I would thank it a lot.

Bye



Mon, 31 Dec 2001 03:00:00 GMT  
 ALink with DJGPP and NAsm?

Quote:

> I'm using djgpp+nasm to write programs, and I used to use the linking
> capabilities of gcc (well, it really calls ld). Now I'm trying to
start
> using ALink, but I have some problems.

> The problem is that when I compile a program with

> gcc -c program.c -o program.o

> and then I do

> alink program.o -o program.exe

> I get a lot of errors (unresolved external ___main and similars).
Then, I
> tried the same thing but with ld, and it gave me the same errors, so
I
> searched for other options. Finally, I found that the correct command-
> line was:

> ld program.o c:\util\djgpp\lib\crt0.o c:\util\djgpp\lib\libc.a
> c:\util\djgpp\lib\libgcc.a -o program.exe

> and it worked.

> But the problem went when I tried the same with alink and it gave me
the
> following error:

> ALINK v1.6 (C) Copyright 1998-9 Anthony
> All Rights Reserved

> Loading file hola.o
> Loading file c:\util\djgpp\lib\crt0.o
> Loading file c:\util\djgpp\lib\libc.a
> 961 symbols
> Loaded first linker member
> Loading file c:\util\djgpp\lib\libgcc.a
> 81 symbols
> Loaded first linker member
> Loading module _main.o/
> Loading module printf.o/
> Loading module crt1.o/
> Loading module exceptn.o/
> .....
> Loading module _udivdi3.o/
> Loading module modfl.o/
> Error, Insufficient memory in call to malloc

> This seems a very strange error, since I suppose that it would be
> possible to use alink to link a djgpp program. So, I think that I'm
doing
> something wrong.

> If any of you can help me, I would thank it a lot.

> Bye

Sorry to disappoint you, but Alink doesn't support DJGPP COFF properly
at v1.6 - Calls will relocate incorrectly, since Alink assumes that all
COFF objects are MSCOFF, and this treats relative calls differently.
This IS fixed in v1.7, which is currently only in development, and will
be released to beta once everything is back in place - I have rewritten
the core, so a few things haven't been re-implemented yet.

This shouldn't cause an "insufficient memory" error, though, just a bad
executable. If at all possible, I would appreciate it if you emailed me
a copy of the object modules and libraries that you are trying to link,
and I will see if I can identify the cause. It could be the way ALINK
uses memory, or the way RSXNT allocates it - try the Native win32
version (if you can), or recompile ALINK from source with DJGPP (this
should work without any changes).

I hope I can do something to rectify your problem,

Anthony
--

http://alink.home.dhs.org/

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 01 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ALink with DJGPP and NAsm?

2. nasm + alink -> section flags

3. nasm + alink -> section flags

4. Question about NASM and ALINK

5. NASM/ALINK screws CreateWindowEx

6. Help interfacing NASM and DJGPP...

7. NASM + DJGPP linking

8. Need help : Problem building a vesa lib with nasm&djgpp

9. Problem building a vesa lib with nasm&djgpp

10. GCC/DJGPP/NASM - HELP!

11. Help interfacing NASM and DJGPP...

12. nasm+gcc+djgpp

 

 
Powered by phpBB® Forum Software