# ./test2
pid 447 (test2), uid 0: exited on signal 4 (core not dumped, err = 2)
[1] Illegal instruction ./test2
# gcc -o api.o -DHAVE_CONFIG_H -I. -I.. -I../include -c api.c
# gcc -o test2 -DHAVE_CONFIG_H -I. -I.. -I../include test1.c api.o
# ./test2
#
The content of the test1.c is always the same.
# cat test1.c
#include <yaml.h>
int main ()
{
yaml_parser_t parser;
yaml_parser_initialize (&parser);
return 0;
}
The obj is correctly endianness swapped in the latter case. Wonder why the same function crashes in one case and not the other.