Closed johnothwolo closed 3 months ago
When declaring function prototypes in a header, the compiler seems to allocate more string space for the unused prototypes. For example:
; Header.inc _printf PROTO, format:PTR BYTE, args:VARARG _scanf PROTO, format:PTR BYTE, args:VARARG
; test.asm ; uasm -macho64 test.asm ; ld test.o -lSystem -o test INCLUDE Header.inc .data fmt DB "Hello %s" message DB "World", 0ah .code _main PROC lea r14, fmt invoke _printf, r14, message ret _main ENDP END
This produces:
ld: mach-o string pool extends beyond end of file file 'test.o' for architecture x86_64
But if scanf is commented out, it links perfectly fine.
Additionally, if I comment out the lines below and force uasm not to skip unused symbols, it works fine. https://github.com/Terraspace/UASM/blob/bffb18461dd541479064990c3b2750ab50ae23e2/macho64.c#L651-L652
I'll check this one, I would think that all public symbols should be included even if unused due to possible linkage, it might be that it needs to check for external as well.
Fixed in 2.56 branch.
When declaring function prototypes in a header, the compiler seems to allocate more string space for the unused prototypes. For example:
This produces:
But if scanf is commented out, it links perfectly fine.
Additionally, if I comment out the lines below and force uasm not to skip unused symbols, it works fine. https://github.com/Terraspace/UASM/blob/bffb18461dd541479064990c3b2750ab50ae23e2/macho64.c#L651-L652