there is already a question asked: undefined reference to `__stack_chk_fail' but that question is undefined reference to __stack_chk_fail and not __stack_chk_fail_local. this Is a linker error i am getting and i have searched but i don't know how to fix it. This is the exact error:
ld: binaries/GlobalDescriptorTable.o: in function
`GlobalDescriptorTable::GlobalDescriptorTable()':
GlobalDescriptorTable.cpp:(.text+0xa6): undefined reference to `__stack_chk_fail_local'
and this is (a part of)the code in GlobalDescriptorTable.cpp:
GlobalDescriptorTable::GlobalDescriptorTable()
: nullSegmentSelector(0,0,0),
unusedSegmentSelector(0,0,0),
codeSegmentSelector(0,64*1024*1024,0x9A),
dataSegmentSelector(0,64*1024*1024,0x92)
{
uint32 i[2];
i[0] = (uint32)this;
i[1] = sizeof(GlobalDescriptorTable) << 16;
//lgdt is an assembly instruction that stands for load global descriptor table
asm volatile("lgdt (%0)": :"p" (((uint8 *) i)+2));
}
Some other information: i am using gcc compiler and ld linker with my own linker file, I am using a class called GlobalDescriptorTable with a constructor and the error is coming from the constructor.
edit: also i am following a youtube tutorial