L1907 linker error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

L1907 linker error

Jump to solution
890 Views
stevec
Contributor III

I have some link errors:

Link Error   : L1907: Fixup overflow in initialise, to avail_msg_list type 1, at offset 0x3B

 

 

Link Error   : L1907: Fixup overflow in initialise, to msg_order_list type 1, at offset 0x3D

 

 

Link Error   : L1907: Fixup overflow in initialise, to message_lengths type 1, at offset 0x3F

 

 

Link Error   : Link failed

 

I defined the segments I wanted the variable arrays to go in

#pragma DATA_SEG FAR_RAM

 

unsigned char avail_msg_list[30];     //table of empty record slots

unsigned char msg_order_list[30];     //table of order of messages

unsigned char message_lengths[30];     //length in pages of each message

 

#pragma DATA_SEG DEFAULT

 

I need these to go into non zero page RAM to free up the zero page area (9S08QE8)

 

I get the failures here:

   for(i = 0; i < 30; i++)

   {

      avail_msg_list[i] = i + 1;      //set up table with 1 to 30

      msg_order_list[i] = 0;          //zero msg order list so no msgs played

      message_lengths[i] = 0;          //zero message lengths table entries...probably not necessary

   }

 

Any suggestions as to what I am doing wrong?

 

Steve



Labels (1)
0 Kudos
1 Solution
648 Views
BlackNight
NXP Employee
NXP Employee

Maybe now I see it:

#pragma DATA_SEG FAR_RAM

does  not make it far (it is using the default address size which is 8bit).

I think the syntax is

#pragma DATA_SEG FAR FAR_RAM

Can you try this?

View solution in original post

0 Kudos
4 Replies
648 Views
BlackNight
NXP Employee
NXP Employee

Are you using these 3 arrays somewhere else too?

Make sure that the header file knows about the pragma too:

#pragma DATA_SEG FAR_RAM

extern unsigned char avail_msg_list[30]; 

extern unsigned char msg_order_list[30];

extern unsigned char message_lengths[30];

#pragma DATA_SEG DEFAULT


Then: in the linker file, have you allocated the FAR_RAM outside the zero page too?


I hope this helps.

0 Kudos
648 Views
stevec
Contributor III

Erich,

Yes I have made the arrays extern in the .h file and the FAR_RAM is specified in the .prm file

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */

    FAR_RAM    ,                        /* non-zero page variables */

                                       INTO  RAM;

But I still get the link error.


Steve

0 Kudos
649 Views
BlackNight
NXP Employee
NXP Employee

Maybe now I see it:

#pragma DATA_SEG FAR_RAM

does  not make it far (it is using the default address size which is 8bit).

I think the syntax is

#pragma DATA_SEG FAR FAR_RAM

Can you try this?

0 Kudos
648 Views
stevec
Contributor III

Erich,

That seems to have sorted it. Many thanks. I thought that telling the compiler where in memory the variables were stored would automatically sort out the addressing mode. I get no compiler/linker errors now thanks. Now to check that the code does what I want it too.

Steve

0 Kudos