r/programming • • Oct 21 '17

Using Java 9 Modularization to Ship Zero-Dependency Native Apps

https://steveperkins.com/using-java-9-modularization-to-ship-zero-dependency-native-apps#.Wes5IMWbUWE.reddit
310 Upvotes

109 comments sorted by

View all comments

Show parent comments

32

u/pjmlp Oct 21 '17

Only when dynamically linked.

4

u/killerstorm Oct 21 '17

Not really, you can avoid using libc functions and use OS functions directly.

6

u/vytah Oct 21 '17
section .data
    msg db      "hello, world!"

section .text
    global _start
_start:
    mov     rax, 1
    mov     rdi, 1
    mov     rsi, msg
    mov     rdx, 13
    syscall
    mov    rax, 60
    mov    rdi, 0
    syscall

5

u/Falmarri Oct 22 '17

Now place it inside the ELF header