History

arm: Fix relocate_section with TCC_OUTPUT_MEMORY

Thomas Stalder committed 10 years ago

Commit 47fd8071 parent 4af25ae1 file · +4 −2Browse files

Unified · Split

tccelf.c+4−2
@@ -791,7 +791,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 790 unmodified lines
791791 {
792792 int x, is_thumb, is_call, h, blx_avail, is_bl, th_ko;
793793 x = (*(int *) ptr) & 0xffffff;
794− if (sym->st_shndx == SHN_UNDEF)
794+ if (sym->st_shndx == SHN_UNDEF
795+ || s1->output_type == TCC_OUTPUT_MEMORY)
795796 val = s1->plt->sh_addr;
796797 #ifdef DEBUG_RELOC
797798 printf ("reloc %d: x=0x%x val=0x%x ", type, x, val);
@@ -1541,7 +1542,8 @@ ST_FUNC void build_got_entries(TCCState *s1) · 743 unmodified lines
15411542 sym_index = ELFW(R_SYM)(rel->r_info);
15421543 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
15431544 if (type != R_ARM_GOTOFF && type != R_ARM_GOTPC
1544− && sym->st_shndx == SHN_UNDEF) {
1545+ && (sym->st_shndx == SHN_UNDEF
1546+ || s1->output_type == TCC_OUTPUT_MEMORY)) {
15451547 unsigned long ofs;
15461548 /* look at the symbol got offset. If none, then add one */
15471549 if (type == R_ARM_GOT32)

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