I use my own modified glibc. I saw in the compiled code that the compiler did not use many of the standard library functions from my glibc when I linked to it. Then I set the flag -fno-builtin. Everything became better, and I saw that now many functions were taken from there that were not taken from glibc, for example malloc.
However, for many functions, such as mmap, the compiler uses some built-in code. Now, how can I ask the compiler to use exclusively code from glibc and not use its built-in functions?
In my x86-64 function, if I execute the objdump of compiled glibc, the next is the generated mmap function. I cannot find equivalent code in glibc source.
0000000000000000 <__mmap>:
0: 49 89 ca mov %rcx,%r10
3: b8 09 00 00 00 mov $0x9,%eax
8: 0f 05 syscall
a: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax
10: 0f 83 00 00 00 00 jae 16 <__mmap+0x16>
16: c3 retq
source
share