History

Call relocate_sym() before we return the offset, so user doesn't need to check the return value twice.

Shinichiro Hamaji committed 17 years ago

Commit d36fea31 parent dd5630f1 file · +5 −5Browse files

Unified · Split

tcc.c+5−5
@@ -10353,6 +10353,11 @@ int tcc_relocate(TCCState *s1, void *ptr) · 10352 unmodified lines
10353 offset = (offset + length + 15) & ~15;10353 offset = (offset + length + 15) & ~15;
10354 }10354 }
10355 10355
10356 /* relocate symbols */
10357 relocate_syms(s1, 1);
10358 if (s1->nb_errors)
10359 return -1;
10360
10356#ifdef TCC_TARGET_X86_6410361#ifdef TCC_TARGET_X86_64
10357 s1->runtime_plt_and_got_offset = 0;10362 s1->runtime_plt_and_got_offset = 0;
10358 s1->runtime_plt_and_got = (char *)(mem + offset);10363 s1->runtime_plt_and_got = (char *)(mem + offset);
@@ -10364,11 +10369,6 @@ int tcc_relocate(TCCState *s1, void *ptr) · 5 unmodified lines
10364 if (0 == mem)10369 if (0 == mem)
10365 return offset + 15;10370 return offset + 15;
10366 10371
10367 /* relocate symbols */
10368 relocate_syms(s1, 1);
10369 if (s1->nb_errors)
10370 return -1;
10371
10372 /* relocate each section */10372 /* relocate each section */
10373 for(i = 1; i < s1->nb_sections; i++) {10373 for(i = 1; i < s1->nb_sections; i++) {
10374 s = s1->sections[i];10374 s = s1->sections[i];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t