History

Give ARM asm mnemonic of PLT entries

Give ARM assembly mnemonic of PLT entries in put_got_entry

Thomas Preud'homme committed 12 years ago

Commit 599677a1 parent 3d4b57f1 file · +9 −9Browse files

Unified · Split

tccelf.c+9−9
@@ -1102,23 +1102,23 @@ static void put_got_entry(TCCState *s1, · 1101 unmodified lines
1102 if (plt->data_offset == 0) {1102 if (plt->data_offset == 0) {
1103 /* first plt entry */1103 /* first plt entry */
1104 p = section_ptr_add(plt, 16);1104 p = section_ptr_add(plt, 16);
1105 put32(p , 0xe52de004);1105 put32(p, 0xe52de004); /* push {lr} */
1106 put32(p + 4, 0xe59fe010);1106 put32(p+4, 0xe59fe010); /* ldr lr, [pc, #16] */
1107 put32(p + 8, 0xe08fe00e);1107 put32(p+8, 0xe08fe00e); /* add lr, pc, lr */
1108 put32(p + 12, 0xe5bef008);1108 put32(p+12, 0xe5bef008); /* ldr pc, [lr, #8]! */
1109 }1109 }
1110 1110
1111 if (s1->sym_attrs[sym_index].plt_thumb_stub) {1111 if (s1->sym_attrs[sym_index].plt_thumb_stub) {
1112 p = section_ptr_add(plt, 20);1112 p = section_ptr_add(plt, 20);
1113 put32(p , 0x4778); /* bx pc */1113 put32(p, 0x4778); /* bx pc */
1114 put32(p+2, 0x46c0); /* nop */1114 put32(p+2, 0x46c0); /* nop */
1115 p += 4;1115 p += 4;
1116 } else1116 } else
1117 p = section_ptr_add(plt, 16);1117 p = section_ptr_add(plt, 16);
1118 put32(p , 0xe59fc004); /* ldr ip, [pc, #4] ; offset in GOT */1118 put32(p, 0xe59fc004); /* ldr ip, [pc, #4] ; GOT entry offset */
1119 put32(p+4, 0xe08fc00c); /* add ip, pc, ip ; absolute address or offset */1119 put32(p+4, 0xe08fc00c); /* add ip, pc, ip ; addr of GOT entry */
1120 put32(p+8, 0xe59cf000); /* ldr pc, [ip] ; load absolute address or load offset */1120 put32(p+8, 0xe59cf000); /* ldr pc, [ip] ; jump to GOT entry */
1121 put32(p+12, s1->got->data_offset);1121 put32(p+12, s1->got->data_offset); /* GOT entry off once patched */
1122 1122
1123 /* the symbol is modified so that it will be relocated to1123 /* the symbol is modified so that it will be relocated to
1124 the PLT */1124 the PLT */

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