Jump to content
Jagware
Sign in to follow this  
SebRmv

RLN

Recommended Posts

SebRmv    2

Hello,

 

I am trying to switch from aln to rln.

I am missing one option of aln which is the flag -y <incdir> that allows to specify include directories for object and archive files.

Is there some equivalent flag in rln?

If not, can you please add this option?

 

Seb

Share this post


Link to post
Share on other sites
SebRmv    2
Hello,

 

I am trying to switch from aln to rln.

I am missing one option of aln which is the flag -y <incdir> that allows to specify include directories for object and archive files.

Is there some equivalent flag in rln?

If not, can you please add this option?

 

Seb

 

Read the sources and seen that RLNPATH environment variable can be set.

So I wrote a small patch to add -y flag, attached to this message.

 

Now another question: would it be difficult to add support for linking with archive files? For the moment, I get "rmvlib.a is not a supported object file" error, which is a bit annoying...

 

0001_Patch_to_add_y_option.patch.zip

Share this post


Link to post
Share on other sites
SebRmv    2

Thanks Shamus. Actually, I don't really need this anymore because...

 

As I had a few days of vacation, I made my own linker using a modern language (yes, you guessed it: OCaml !)

 

The project is hosted on github and is GPLv3.

 

Of course, it needs a lot of testing and all that... but I managed to link some of my programs successfully, so I guess it is a good start :)

 

The supported modes are (for now):

- partial linking (local and debug symbols are pruned) -> O files

- absolute linking -> ABS files with/without header and COFF files (no debug symbol, no relocatable segment)

Share this post


Link to post
Share on other sites
SebRmv    2
Thanks Shamus. Actually, I don't really need this anymore because...

 

As I had a few days of vacation, I made my own linker using a modern language (yes, you guessed it: OCaml !)

 

The project is hosted on github and is GPLv3.

 

Of course, it needs a lot of testing and all that... but I managed to link some of my programs successfully, so I guess it is a good start :)

 

The supported modes are (for now):

- partial linking (local and debug symbols are pruned) -> O files

- absolute linking -> ABS files with/without header and COFF files (no debug symbol, no relocatable segment)

 

An alpha version is available here for Windows users. Your feedback is welcome :)

Share this post


Link to post
Share on other sites
Orion_    1

I stumbled across a nasty bug this weekend, I almost went crazy ...

It appears to be a linking problem from RLN, between C object code (from VBCC) and ASM object code from RMAC.

 

In my C code I had a function pointer declared and initialised like this:

u16	(*iclTMtiledraw_callback)(u16 tile);

iclTMtiledraw_callback = NULL;

in my ASM code I used this function pointer, but I also had a declaration of it in the BSS:

	move.l	_iclTMtiledraw_callback,a1

	.bss
	.globl	_iclTMtiledraw_callback
_iclTMtiledraw_callback:	ds.l	1

My mistake here was that I forgot the "extern" in the C code.

So the function pointer was declared 2 times ! and the address used in the C code was different from the address in the ASM code (hence the random crash depending on the init of the bss)

 

Now, why didn't RLN showed me an error saying that this variable was declared 2 times and that there was a conflict between them ?

That would have saved me 2 days of headaches :(

 

Good thing is, I was convinced that the problem was from the Blitter which I use a lot, so I shielded my code about this, now I guess, there won't be any problem related to "wait for the blitter to finish before modifying its registers".

Share this post


Link to post
Share on other sites
Michael    0

H Orion,

In my C code I had a function pointer declared and initialised like this:

u16	(*iclTMtiledraw_callback)(u16 tile);

iclTMtiledraw_callback = NULL;

in my ASM code I used this function pointer, but I also had a declaration of it in the BSS:

	move.l	_iclTMtiledraw_callback,a1

	.bss
	.globl	_iclTMtiledraw_callback
_iclTMtiledraw_callback:	ds.l	1
Now, why didn't RLN showed me an error saying that this variable was declared 2 times and that there was a conflict between them ?

I think, your C Code has a variable which is part of the data segment because it is a initialized global variable. Your assembler variable is in a different segment. So it was no problem for the linker to have the variable twice, one i the data segment and one in the bss segment. I noticed this problem many years ago with a different compiler.

 

Best regards

Michael

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×