Re: [Flashforth-devel] building flashforth with avra?
Brought to you by:
oh2aun
From: Christopher H. <chr...@li...> - 2021-05-04 12:36:08
|
I believe that I should be able to figure out linker scripts, though in the process I am getting stuck on another linker issue. I modified the XC directive to a simple .section NRWW and tried avr-gcc --verbose -mmcu=atmega328p -I. -D__ATmega328P__ -x assembler-with-cpp ff- libre.asm, in hopes that verbose output would dump the exact location of the default linker script, which I could use as a starting point. (According to gcc docs there is always a default linker script if non is specified.) Insteader linker dies with error avr-ld: /home/christopher/.guix- profile/avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main' I guess I need to figure out what to pass in to avr-gcc to fit the FlashForth entry paradigm. I looked for some guidance from avr-libc- users-manual, which has a lot of info on assembly and AVR, but the paradigm there seems to expect that you have a .text section, a main(), and maybe an .initN section. On Tue, 2021-05-04 at 13:06 +0300, Mikael Nordman wrote: > Hi Chris, > Here is the link for the answer I got from Microchip. They modified > the XC8 suite somehow. Maybe both AVR-AS and AVR-LD. > https://www.microchip.com/forums/m1170217.aspx > It is possible use a custom linker script instead, but I did not want > to maintain linker files for FlashForth. > If you come up with the linker scripts for the supported Atmegas, I > can add them into FlashForth. > BR Mikael > > > On 2021-05-04 09:01, Christopher Howard wrote: > > That you for your help. > > > > I'm no expert on the subject at this point, but it seems like there > > must be some better way to do this than filling a ton of memory > > each time I upload FlashForth to a chip. Seems like I should be > > able to get something equivalent to .NRWW directive with some > > combination of a named section and a section address in a linker > > script. > > > > I'm mildly curious what is really going on behind that XC8 .NRWW > > "addition". Unless they've somehow crossed the assembler/linker > > boundry, they must pass some extra information on to the linker...? > > Something that gives instructions to their own linker script, or to > > a modified Gnu LD? > > > > Anyway, sounds like I've finally got an excuse now to become an > > expert on linking. > > -- Christopher Howard blog: https://librehacker.com social: https://gnusocial.club/librehacker |