Accept symbols in initializers also on 64 bit

Those should use long or long long type, and generate a 64bit reloc.
This commit is contained in:
Michael Matz
2016-07-11 16:26:36 +02:00
parent 920474115c
commit 10c3514889
2 changed files with 20 additions and 3 deletions

View File

@ -2230,10 +2230,17 @@ int reltab[3] = { 1, 2, 3 };
int reltab[3] = { 1, 2, 3 };
int *rel1 = &reltab[1];
int *rel2 = &reltab[2];
void getmyaddress(void)
{
printf("in getmyaddress\n");
}
unsigned long theaddress = (unsigned long)getmyaddress;
void relocation_test(void)
{
void (*fptr)(void) = (void (*)(void))theaddress;
printf("*rel1=%d\n", *rel1);
printf("*rel2=%d\n", *rel2);
fptr();
}