Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
318 views

llvm zerofill section in segment other than __DATA on MacOS Catalina

I have a forth system that can produce self modifying code. Currently, I have put the place where the forth words and assembly is created in the __DATA segment, and consequently, I need to mark the ...
Klapaucius Klapaucius's user avatar
2 votes
1 answer
2k views

assembly -- difference between `.text` and `.section __TEXT` on macOS?

When writing assembly codes manually on macOS, .section .text will lead to "unexpected token in '.section' directive" error, and to fix is to remove .section token. But when I generate assembly codes ...
Evian's user avatar
  • 1,215
0 votes
1 answer
1k views

How to generate executable from LLVM IR

I was reading http://www.stephendiehl.com/llvm/#llvm-introduction there is a piece of LLVM IR like this: declare i32 @putchar(i32) define i32 @add(i32 %a, i32 %b) { %1 = add i32 %a, %b ret i32 %...
jiyinyiyong's user avatar
  • 4,733
1 vote
2 answers
417 views

Reassigning non-absolute variables in OSX's assembler

The following assembler directives, when compiled with clang on OSX, produce an error: .set link,0 test: .int link .set link,test test2: .int link .set link,test2 The error: $ clang test.s ...
nornagon's user avatar
  • 15.9k
3 votes
2 answers
1k views

OS X asm C call with return value

I've been playing around with the asm macro in C to directly call some assembly instructions on OS X Mavericks to get a stack pointer address (from %rsp) and I've found really strange behaviour (at ...
Brano H.'s user avatar
9 votes
2 answers
762 views

MAC OSX Intel LLVM Assembler bug (causes Vorbis OGG loader to crash)

I had mysterious bug in loading Vorbis Ogg files on Mac OSX. The first file is loaded correctly, the second crashes in some code that indicates the file is corrupted, the same happens even if I load ...
Auday's user avatar
  • 171