Bug 175

Summary: The equates generate Global Symbol in ELF format
Product: RMAC Reporter: djipi.mari
Component: CoreAssignee: Shamus Hammons <jlhamm>
Status: RESOLVED FIXED    
Severity: major CC: ggnkua, jlhamm
Priority: Normal    
Version: unspecified   
Hardware: PC   
OS: All   
Attachments: Log file
Vlink script
object generated by rmac
object generated by rmac
MAKEFILE to add ELF format
The patches!

Description djipi.mari 2020-09-21 00:54:58 CDT
When using equates function, such as equ, equr, etc., the symbols are generated  as global.

Such situation leads to "already defined" errors during linking. It appears especially when symbols are present in an .inc file and used by multiples asm files.
Comment 1 Shamus Hammons 2020-09-28 22:12:43 CDT
Can you attach an example which demonstrates the problem?  It can be short, just as long as it demonstrates the problem you're describing.  Include any link steps as well as flags for the assembler.
Comment 2 djipi.mari 2020-09-29 05:50:45 CDT
Created attachment 149 [details]
Log file

The file contains both one assembly source and linking messages.
Comment 3 djipi.mari 2020-09-29 05:51:35 CDT
Sure. I have used the RENDER package (3D library).

I have added files to demonstrate the issue. Please let me know if you need additional information.

I use rmac V2.0.21 and added a small patch to handle multiple -i option because my make version on windows got problem when using unique -i option with a ';' as separator for each path.
Note: I have tried another source without my patch and the "already defined" errors during linking is still present.
Comment 4 djipi.mari 2020-09-29 05:52:16 CDT
Created attachment 150 [details]
Vlink script
Comment 5 djipi.mari 2020-09-29 05:52:47 CDT
Created attachment 151 [details]
object generated by rmac
Comment 6 djipi.mari 2020-09-29 05:53:21 CDT
Created attachment 152 [details]
object generated by rmac
Comment 7 djipi.mari 2020-09-29 05:54:10 CDT
Created attachment 153 [details]
MAKEFILE to add ELF format
Comment 8 ggn 2021-10-18 10:28:42 CDT
Created attachment 166 [details]
The patches!

Right, sorry for taking this long to respond to this.

Seems like all the symbols in your test case in fact come from .equr statements. These shouldn't be exported in the first place, so I added some extra filtering in the ELF exporter.

That should take care of things.

If possible, can you download this patch, apply it to your rmac build and try building your test case?

Thanks
Comment 9 djipi.mari 2021-10-18 15:05:01 CDT
Hi,
Applied the patch and did the test case. The patch has fixed the issue.
Thanks.
Comment 10 Shamus Hammons 2021-10-30 10:04:35 CDT
Please let us set the status to RESOLVED FIXED in the future, as this fell off of my bug list and the patch had not yet been applied to the source repo.  Thanks!  :-)
Comment 11 Shamus Hammons 2021-10-30 10:14:45 CDT
There is now a TESTED status, so if the patches work then you can set the bug to TESTED and we will know that it's ready to be added to the source repo.