Skip to content

Commit af90f31

Browse files
committed
Rewrite ARM instructions in Thumb
1 parent 2240d99 commit af90f31

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

ext/sass/Rakefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ file 'true' do |t|
181181
e_flags = 0x5000400
182182

183183
# 00400054 <PT_LOAD#0>:
184-
# 400054: e3a00000 mov r0, #0
185-
# 400058: e3a07001 mov r7, #1
186-
# 40005c: ef000000 svc #0x0
187-
entry_point = [0xe3a00000, 0xe3a07001, 0xef000000].pack('L<3')
184+
# 400054: 2701 movs r7, #0x1
185+
# 400056: 2000 movs r0, #0x0
186+
# 400058: df00 svc #0x0
187+
entry_point = [0x2701, 0x2000, 0xdf00].pack('S<3')
188188
when 'riscv64'
189189
ei_class = ELF::ELFCLASS64
190190
ei_data = ELF::ELFDATA2LSB
@@ -236,12 +236,15 @@ file 'true' do |t|
236236
else
237237
raise EncodingError
238238
end
239-
e_phoff = e_ehsize
240-
p_offset = e_phoff + e_phentsize
241-
e_entry = (2**22) + p_offset
242-
p_vaddr = e_entry
239+
240+
p_offset = e_ehsize + e_phentsize
241+
p_vaddr = (2**22) + p_offset
243242
p_filesz = entry_point.length
244243
p_memsz = p_filesz
244+
e_phoff = e_ehsize
245+
246+
e_entry = p_vaddr
247+
e_entry += 1 if Platform::CPU == 'arm'
245248

246249
@ehdr = {
247250
e_ident: [127, 69, 76, 70, ei_class, ei_data, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],

0 commit comments

Comments
 (0)