Linker reference error for a too big array
Posted: Wed Apr 06, 2011 2:20 pm
I have a big array, 103680 bytes of 256 elements declared in the global scope. The linker is giving me a reference error at address .text+0x174 for this, because if a delete some items of the struct it works well. The reference error is very strange because it calls _memcpy a function not declared with the C calling conventions. My linker script is
EDIT: the problem isn't the array itself but the structure =.= How is it possible?
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
INPUT
(
start.o
main.o
bA.o
sys.o
dbg.o
ev.o
mem.o
drv.o
lib.o
)
OUTPUT(Kernel.bin)
SECTIONS
{
. = 0x100000;
.text :
{
code = .;
*(.text*)
*(.gnu.linkonce.t*)
}
.rodata :
{
*(.rodata*)
*(.gnu.linkonce.r*)
}
.data :
{
start_ctors = .;
*(.ctor*)
end_ctors = .;
start_dtors = .;
*(.dtor*)
end_dtors = .;
*(.data*)
*(.gnu.linkonce.d*)
}
.bss :
{
bss = .;
*(.COMMON*)
*(.bss*)
*(.gnu.linkonce.b*)
}
/DISCARD/ :
{
*(.comment)
*(.eh_frame)
}
end = .;
}
Code: Select all
struct console{
uint8 id; //The id of the console
void *appLink; //The application which uses it
uint32 session; //The session id generated by the kernel
uint8 active;
//On direct video
uint16 maxX;
uint16 maxY;
uint16 x;
uint16 y;
uint8 endLine;
uint32 buffer; //Memoryblock index
uint16 pages;
//On buffer
uint16 scrollY; //Absolute
uint16 topY;
//Color object
union{
uint8 color;
struct{
uint8 hcolor:4;
uint8 lcolor:4;
};
};
//Palette
uint32 palette[16];
void (*cls)();
void (*refresh)();
void (*put)(char ch);
void (*putpure)(char ch);
char (*getc)();
wchar (*getwc)();
char (*hgetc)();
wchar (*hgetwc)();
void (*refreshPalette)(uint32 *p);
uint8 command[256];
char name[11];
uint32 (*getCMD)();
uint32 (*parser)();
};