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
791 {791 {
792 int x, is_thumb, is_call, h, blx_avail, is_bl, th_ko;792 int x, is_thumb, is_call, h, blx_avail, is_bl, th_ko;
793 x = (*(int *) ptr) & 0xffffff;793 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)
795 val = s1->plt->sh_addr;796 val = s1->plt->sh_addr;
796#ifdef DEBUG_RELOC797#ifdef DEBUG_RELOC
797 printf ("reloc %d: x=0x%x val=0x%x ", type, x, val);798 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
1541 sym_index = ELFW(R_SYM)(rel->r_info);1542 sym_index = ELFW(R_SYM)(rel->r_info);
1542 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];1543 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
1543 if (type != R_ARM_GOTOFF && type != R_ARM_GOTPC1544 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)) {
1545 unsigned long ofs;1547 unsigned long ofs;
1546 /* look at the symbol got offset. If none, then add one */1548 /* look at the symbol got offset. If none, then add one */
1547 if (type == R_ARM_GOT32)1549 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