gnupic: emulating linker script functionality?
Subject:
emulating linker script functionality?
From:
Charles Lepple ####@####.####
Date:
16 Dec 2002 04:48:22 -0000
Message-Id: <3DFD5999.2030008@ghz.cc>
Please bear with me as I try and explain what I want to do. I'm a little
rusty when it comes to PIC programming, and so my terminology might be
slightly off.
I downloaded some sample code from Microchip which is intended to
demonstrate the use of the USB peripheral on the 16C745/765 chips. It is
designed to be assembled and linked with MPASM, and it uses several .ASM
files and a linker script.
Since I realize that the gputils linker is not finished, I concatenated
the files in the link order given in the project file, commented out the
'global' directives, and replaced the first of each 'extern' directive
with the symbol definition itself.
That worked fine, except that since the linker script is never
consulted, the vectors are not placed at the beginning of program space,
etc. (from "CODEPAGE NAME=vectors START=0x0 END=0x4F
PROTECTED" and "SECTION NAME=STARTUP ROM=vectors" in the linker script).
Has anyone else run into this before? I think I can move most of the
code around by hand, but I was looking for a more formal method. Also,
I'm kind of in the dark since I didn't write the original code, and I'm
sure there are things that will take a few crash-and-burn cycles to work
out.
Also, if you've read this far, then maybe this next suggestion might
interest you: has anyone considered integration with GNU binutils? I
realize that a lot of work has been put into gputils, but the GNU linker
is pretty advanced, and would make a nice framework. Plus, it already
has a modular COFF support system which could be adapted to work with
the Microchip object format (if it is indeed a variant of COFF). I have
had some experience porting binutils, but at the moment my hands are
tied (the FSF needs a copyright assignment from me, and my university is
being a pain about signing it) so I can only answer porting questions at
the moment (no code writing). Food for thought, anyway...
--
Charles Lepple ####@####.####
http://www.ghz.cc/charles/