Call relocate_sym() before we return the offset, so user doesn't need to check the return value twice.
This commit is contained in:
parent
dd5630ff95
commit
d36fea34e3
1 changed files with 5 additions and 5 deletions
10
tcc.c
10
tcc.c
|
|
@ -10353,6 +10353,11 @@ int tcc_relocate(TCCState *s1, void *ptr)
|
||||||
offset = (offset + length + 15) & ~15;
|
offset = (offset + length + 15) & ~15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* relocate symbols */
|
||||||
|
relocate_syms(s1, 1);
|
||||||
|
if (s1->nb_errors)
|
||||||
|
return -1;
|
||||||
|
|
||||||
#ifdef TCC_TARGET_X86_64
|
#ifdef TCC_TARGET_X86_64
|
||||||
s1->runtime_plt_and_got_offset = 0;
|
s1->runtime_plt_and_got_offset = 0;
|
||||||
s1->runtime_plt_and_got = (char *)(mem + offset);
|
s1->runtime_plt_and_got = (char *)(mem + offset);
|
||||||
|
|
@ -10364,11 +10369,6 @@ int tcc_relocate(TCCState *s1, void *ptr)
|
||||||
if (0 == mem)
|
if (0 == mem)
|
||||||
return offset + 15;
|
return offset + 15;
|
||||||
|
|
||||||
/* relocate symbols */
|
|
||||||
relocate_syms(s1, 1);
|
|
||||||
if (s1->nb_errors)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* relocate each section */
|
/* relocate each section */
|
||||||
for(i = 1; i < s1->nb_sections; i++) {
|
for(i = 1; i < s1->nb_sections; i++) {
|
||||||
s = s1->sections[i];
|
s = s1->sections[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue