English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 18 August 2018, 13:32   #1
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 835
Preventing hunk merger with vlink

Hi,

It is possible to tell vlink not to merge bss and/or data hunks?

I want to do the following:

compile multiple 68k sources to one 68k object file, then compile multiple ppc sources to one ppc object file. Both with merging enabled. Then I'd like to link the two to a WarpOS executable, but want the data hunks of the 68k not merged with the ppc data hunks (as happens now).

I'm specifically looking at the Quake source on Frank Wille's site (which is down atm).

It is to test if interrupt code and/or data placed in PCI memory (with a PCI PPC card and Mediator) is to blame for sound not working on A1200 mediators with a PCI PPC card. I want to push this 68k data/code forcibly to Fast RAM (after compiling setting bit 31 of the 68k data and code hunks).

As said, as a test.

Thanks for any help.
Hedeon is offline  
Old 18 August 2018, 16:18   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,221
Quote:
Originally Posted by Hedeon View Post
It is possible to tell vlink not to merge bss and/or data hunks?
As with most linkers, just give the sections different names.
Do not specify -sd (small data), which will merge all data and bss.

Quote:
compile multiple 68k sources to one 68k object file, then compile multiple ppc sources to one ppc object file. Both with merging enabled.
What does "merging enabled" mean for you? I guess you are talking about the default behaviour: merge sections with same name and those with the name "__MERGED"?

Quote:
Then I'd like to link the two to a WarpOS executable, but want the data hunks of the 68k not merged with the ppc data hunks
That's not a good idea. The most important data section for the WarpOS PowerOpen-ABI is the TOC section (named ".tocd"). It contains all variables with elementary data types (i.e. sizes <= 8 bytes) and pointers to other objects (array, structures, etc.). It is shared between the 68k startup code and the PPC code. The 68k startup code initializes PowerPCBase, DOSBase, SysBase, WBenchMsg, etc.., which would no longer be accessible for the PPC when you move them out of TOC.

Quote:
I'm specifically looking at the Quake source on Frank Wille's site (which is down atm).
Arrrgh! Seems I have to reboot the server on Monday again. The current kernel has frequent file system lock-ups.

Quote:
It is to test if interrupt code and/or data placed in PCI memory (with a PCI PPC card and Mediator) is to blame for sound not working on A1200 mediators with a PCI PPC card. I want to push this 68k data/code forcibly to Fast RAM (after compiling setting bit 31 of the 68k data and code hunks).
Hmm. The 68k code should not be in PCI memory. It is always a different section than the PPC code ("CODE" versus ".text").

For the data I would use a trick: Just make sure all relevant data for your sound interrupt routine is in a structure, which can be referenced via a pointer. So only the pointer will be placed into .tocd. The structure will be in .data or .bss, which is a separate section.

I'm certainly lacking some information here. Maybe a map file from vlink (-M option) shows some more details about your linking process.
phx is offline  
Old 24 August 2018, 15:40   #3
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 835
Thanks for your reply. The part about the toc makes sense. Bummer.

And yes, ppc code and 68k code ends up in different hunks but as they are all $3e9 I cannot differentiate between them easily using detection code.

Anyway, I did it all manually (moving 68k code hunks to the correct ram) but it still crashes on the 1200. Maybe I should try to understand more how AHI hooks work....Cause i think the problem lies in there somewhere.
Hedeon is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing background interaction when running in QAMIGA mode earok Coders. Blitz Basic 4 05 April 2018 03:06
WinUAE preventing screensaver trumpy81 support.WinUAE 7 13 March 2018 01:35
Trying out vlink and vasm cla Coders. General 2 30 September 2016 21:30
CIA & VITNO Retrogaming Forum upgraded to vB 4.2.1 & Merger DH News 1 19 September 2016 22:39
Preventing amigas from getting yellow with time paulo_becas support.Hardware 19 28 June 2015 17:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07525 seconds with 13 queries