These are the two warnings that I fixed:
/src/dynamic_libs/os_functions.c: In function '_os_find_export':
/src/dynamic_libs/os_functions.c:171:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < sizeof(a) - 1; i++)
^
/src/dynamic_libs/os_functions.c:177:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < sizeof(b) - 1; i++)
^
OSAllocFromSystem allocates a physically contiguous area of memory, and
returns a pointer to it as a virtual address in the calling process's
address space. OSFreeToSystem is the corresponding free function.
This brought the file size of os_functions.o (compiled at -O2, not stripped)
from 15K to 9.7K. Section sizes changed in the following ways:
.text .rela.text .data .rodata.str1.4 .syntab .strtab .shstrtab
before 5660 2928 276 3111 1264 1255 89
after 2860 2376 276 1175 1296 1294 89
The most obvious win is due to not including two strings per imported function
("OSFoo" and "Function OSFoo is NULL") in the .rodata section anymore, but
outlining the error-handling code also reduced the size of .text significantly.