This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [z80-coff-ld] how can I use ld for creating an exe from z80-coff-as ?


Hi Jseb.

I do a lot of complicated Z80 development using binutils, and have set
up a z80 specific makefile that sorts this all out. I include this
makefile in all my project makefiles to provide all the functionality
I need. I also have a platform specific linker script that defines
useful memory regions that I use. I can then target code to the memory
regions/segments as necessary.

Extracting the final linked binary is done through objcopy, with
listing dumps and map output done through objdump. It does what you
expect, and works beautifully for me at least.

Happy to share this base makefile and linker scripts with you, with
some examples (been meaning to write it all up and publish on my
website....)

Chris



On 21 February 2012 21:52, Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Feb 21, 2012 at 10:06:41PM +0100, jseb wrote:
> > ... to my .org setting.
>
> .org doesn't do what you think it does.  gas isn't an absolute
> assembler, but instead produces relocatable object files.  .org just
> adds space to make the offset from the start of the current section
> equal to its argument.
>
> You're on the right track in your use of a linker script to set the
> start of your code.  Just leave out the .org in the assembly code.
>
> --
> Alan Modra
> Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]