Mitchell Baldwin RMBIMedical.com -----Original Message----- From: piclist-bounces@mit.edu On Behalf Of Matthe= w Miller Sent: Tuesday, May 8, 2018 8:51 PM To: Microcontroller discussion list - Public. Subject: Re: [PIC] Troubles implementing relocatable code On Tue, May 8, 2018 at 1:45 PM, Dwayne Reid wrote: > Good day to all. >From your description it seems the code is the same except fro the absolute vs. relocatable differences. Look at the .map file the linker produces to see if the code is in locations where you expect it. In MPLAB-X there's a bothersome MAIN.O object file that allocated to a .cinit section. If you're using plain assembly you don't need this and the linker dumbly puts this code between the reset and interrupt vectors (or elsewhere). I'll add a section like this to the linker script: // http://www.microchip.com/forums/m825351.aspx#825477 CODEPAGE NAME=3D.cinit START=3D0xFB0 END=3D0xFFF PROTECTED // Unimplemented memory SECTION NAME=3D.cinit ROM=3D.cinit // Useless initialization stuff so the .cinit section is located in a bogus memory area. I've found no way to prevent that MAIN.O object file from being linked in. Matthew -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/chang= e your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .