01 December 2017, 22:03 | #1 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
vbcc bss clearing issue
I've been having some trouble with constant data included in my program being cleared already before my program starts running.
So I disassembled to linked executable of my program, and found this piece of code just 5 rows into the program. It is a loop which iterates 0x30 (48) times. Each time clearing one longword. Code:
MOVE.L #$00000030,D0 BEQ.S LAB_0002 LEA __BSSBAS,A0 LAB_0001: CLR.L (A0)+ SUBQ.L #1,D0 BNE.S LAB_0001 LAB_0002: Code:
SECTION S_2,DATA SECSTRT_2: DC.L $00220063,$41000000 __BSSBAS: DS.L 1 _SysBase: DS.L 1 _DOSBase: DS.L 1 _WBenchMsg: DS.L 1 __WBenchMsg: DS.L 1 __stdin: DS.L 1 __stdout: DS.L 1 __stderr: DS.L 1 _errno: DS.L 1 ___stack_usage: DS.L 1 ___stackLower: DS.L 1 ___stackPtr: DS.L 1 SECTION S_3,DATA SECSTRT_3: DS.L 1 _GfxBase: DS.L 1 The clearing loop in the beginning of the program appears to be clearing 4 times the data it should. So it basically goes on to clear some constant data I have included in my program. Very strange! Is it a bug in vbcc? VBCC 0.9e |
02 December 2017, 20:20 | #2 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
This title of this post is actually not accurate. It's not clearing bss data, it's clearing a normal data section which happens to hold a bss pointer.
Still, I'm pretty confident it's a bug in the m68k-kick13 targets startup.o. It basically clears a number of longwords instead of that number of bytes. |
02 December 2017, 21:36 | #3 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
In my startup code source the "move.l #$00000030,d0" is Code:
move.l #__BSSLEN,d0 Code:
- 0.16 (16.05.17) ... o (ados/ehf): Fixed SAS/C-compatibility linker symbol __BSSLEN. Now it represents the number of long words instead of the number of bytes. WARNING! Make sure to check your code, if you used __BSSLEN before! Quote:
|
||
02 December 2017, 22:50 | #4 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
I see! It looks like I have mismatched target and linker versions. I've actually been changing back and forth between different compiler/linker versions without considering the targets.
Thanks for your reply! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vbcc 0.9f (windows) local includes issue? | dalton | Coders. C/C++ | 4 | 29 July 2017 21:33 |
Devpac - CNOP in a BSS Section | h0ffman | Coders. Asm / Hardware | 30 | 18 March 2015 23:12 |
Clearing the X-bit | oRBIT | Coders. Asm / Hardware | 6 | 22 April 2012 02:52 |
newest ami/x and cnet bss | GreenMeanie | request.Apps | 1 | 16 September 2011 20:12 |
Federation of the Free Traders + BSS Jane Seymour | haynor666 | MarketPlace | 0 | 06 June 2003 15:19 |
|
|