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
1035310353 offset = (offset + length + 15) & ~15;
1035410354 }
1035510355
10356+ /* relocate symbols */
10357+ relocate_syms(s1, 1);
10358+ if (s1->nb_errors)
10359+ return -1;
10360+
1035610361 #ifdef TCC_TARGET_X86_64
1035710362 s1->runtime_plt_and_got_offset = 0;
1035810363 s1->runtime_plt_and_got = (char *)(mem + offset);
@@ -10364,11 +10369,6 @@ int tcc_relocate(TCCState *s1, void *ptr) · 5 unmodified lines
1036410369 if (0 == mem)
1036510370 return offset + 15;
1036610371
10367− /* relocate symbols */
10368− relocate_syms(s1, 1);
10369− if (s1->nb_errors)
10370− return -1;
10371−
1037210372 /* relocate each section */
1037310373 for(i = 1; i < s1->nb_sections; i++) {
1037410374 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