[Nasm-bugs] [Bug 3392469] mach-o executables crash with dead striping due to missing object relocations.
noreply-nasm at gorcunov.org
noreply-nasm at gorcunov.org
Tue Jun 26 08:47:56 PDT 2018
https://bugzilla.nasm.us/show_bug.cgi?id=3392469
zenith432 at users.sourceforge.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |OPEN
CC| |zenith432 at users.sourceforge
| |.net
Resolution|FIXED |---
--- Comment #12 from zenith432 at users.sourceforge.net ---
I tested with
NASM version 2.14rc11 compiled on Jun 25 2018
(downloaded from site)
It is getting closer, but still not right. Symbols are wrong.
nasm -f macho32 IoFifoSev.nasm
objdump -d -r -t IoFifoSev.o
==========
IoFifoSev.o: file format Mach-O 32-bit i386
Disassembly of section __TEXT,__text:
_SevNoRepIo:
0: 53 pushl %ebx
1: 51 pushl %ecx
2: 52 pushl %edx
3: 31 c0 xorl %eax, %eax
5: 5a popl %edx
6: 59 popl %ecx
7: 5b popl %ebx
8: c3 retl
9: 57 pushl %edi
a: e8 f1 ff ff ff calll -15 <_SevNoRepIo>
0000000b: GENERIC_RELOC_VANILLA __text
f: 85 c0 testl %eax, %eax
11: 5f popl %edi
12: 57 pushl %edi
13: e9 e8 ff ff ff jmp -24 <_SevNoRepIo>
00000014: GENERIC_RELOC_VANILLA __text
18: 85 c0 testl %eax, %eax
1a: 5f popl %edi
1b: c3 retl
SYMBOL TABLE:
00000000 g F __TEXT,__text _IoReadFifo16
00000000 g F __TEXT,__text _IoReadFifo16
00000000 g F __TEXT,__text _IoReadFifo8
00000000 g F __TEXT,__text _IoReadFifo8
00000000 g F __TEXT,__text _SevNoRepIo
00000000 g F __TEXT,__text _SevNoRepIo
==========
This is what it should look like from clang
clang -arch i386 -c IoFifoSevS.S
objdump -d -r -t IoFifoSevS.o
==========
IoFifoSevS.o: file format Mach-O 32-bit i386
Disassembly of section __TEXT,__text:
_SevNoRepIo:
0: 53 pushl %ebx
1: 51 pushl %ecx
2: 52 pushl %edx
3: 31 c0 xorl %eax, %eax
5: 5a popl %edx
6: 59 popl %ecx
7: 5b popl %ebx
8: c3 retl
_IoReadFifo16:
9: 57 pushl %edi
a: e8 f1 ff ff ff calll -15 <_SevNoRepIo>
0000000b: GENERIC_RELOC_VANILLA __text
f: 85 c0 testl %eax, %eax
11: 5f popl %edi
_IoReadFifo8:
12: 57 pushl %edi
13: e8 e8 ff ff ff calll -24 <_SevNoRepIo>
00000014: GENERIC_RELOC_VANILLA __text
18: 85 c0 testl %eax, %eax
1a: 5f popl %edi
1b: c3 retl
SYMBOL TABLE:
00000009 g F __TEXT,__text _IoReadFifo16
00000012 g F __TEXT,__text _IoReadFifo8
00000000 g F __TEXT,__text _SevNoRepIo
==========
Because of symbols wrong, nasm output doesn't link.
clang -arch i386 main.c IoFifoSev.o -dead_strip
duplicate symbol _IoReadFifo16 in:
IoFifoSev.o
duplicate symbol _IoReadFifo8 in:
IoFifoSev.o
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
More information about the Nasm-bugs
mailing list