larmel / lacc

A simple, self-hosting C compiler
MIT License
872 stars 64 forks source link

ld can not find the input symbol _start #35

Open arteze opened 2 years ago

arteze commented 2 years ago

I'm trying to compile the test main.

int main() {
    int a;
    a = 42;
    return a;
}

An error ld appears to me:

lacc ./main.c -o ./bin/o
/usr/bin/ld -L/usr/local/lib -L/usr/lib main.o -o ./bin/o -lc 
/usr/bin/ld: aviso: no se puede encontrar el símbolo de entrada _start; se usa por defecto 0000000000401000

/usr/bin/ld: warning: You can not find the input symbol _start; It is used by default 0000000000401000

arteze commented 2 years ago

To solve it I had to do so.

void _start() {main();}

Another problem that I have is that what I compile, does not execute it. I have architecture AMD64.

For example, when compiling this, it does not execute in my system.

#include <stdio.h>
int main() {printf("Hi\n");return 0;}
void _start() {main();}

The resulting file:

ELF>9@@02@@@@@@@��@@@@��@@DD  @�.�>@�>@pp�.�>@�>@PPR�td�.�>@�>@PP/lib/ld64.so.1printflibc.so.6GLIBC_2.2.5ui  @@�50�%0@�%0h�����UH��H�=������1���UH���������Hola
@���o(@x@H@

 @@�@���o�@���o���o�@�>@@��

�>@@@. @@5H @@R
9@
   M @@Y
 @./main.c.LC1_DYNAMIC_GLOBAL_OFFSET_TABLE__edataprintf@GLIBC_2.2.5_end__bss_startmain.symtab.strtab.shstrtab.interp.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.plt.text.rodata.eh_frame.dynamic.got.plt@'@#���o(@(-
                                                                                                                     H@H05x@x=���o�@�J���o�@� YB�@�^@ c @ $i @ q {�>@�.P�@@ 0    @1^�1�~
7f454c4602010100000000000000000002003e000100000039104000000000004000000000000000
30320000000000000000000040003800080040001200110006000000040000004000000000000000
40004000000000004000400000000000c001000000000000c0010000000000000800000000000000
03000000040000000002000000000000000240000000000000024000000000000f00000000000000
0f000000000000000100000000000000010000000400000000000000000000000000400000000000
0000400000000000d802000000000000d80200000000000000100000000000000100000005000000
00100000000000000010400000000000001040000000000044000000000000004400000000000000
00100000000000000100000004000000002000000000000000204000000000000020400000000000
0800000000000000080000000000000000100000000000000100000006000000b02e000000000000
b03e400000000000b03e400000000000700100000000000070010000000000000010000000000000
0200000006000000b02e000000000000b03e400000000000b03e4000000000005001000000000000
5001000000000000080000000000000052e5746404000000b02e000000000000b03e400000000000
b03e4000000000005001000000000000500100000000000001000000000000002f6c69622f6c6436
342e736f2e3100000100000002000000010000000000000000000000000000000100000001000000
01000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000010000001200000000000000000000000000000000000000007072696e746600
6c6962632e736f2e3600474c4942435f322e322e3500000002000000000000000100010008000000
1000000000000000751a690900000200120000000000000018404000000000000700000001000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000ff3502300000ff25043000000f1f4000ff25023000006800
000000e9e0ffffff554889e5488d3dd50f0000b800000000e8dbffffff31c0c9c3554889e5e8deff
ffffc9c3000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000486f6c610a000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000100000000000000
080000000000000004000000000000001002400000000000f5feff6f000000002802400000000000
05000000000000007802400000000000060000000000000048024000000000000a00000000000000
1e000000000000000b00000000000000180000000000000015000000000000000000000000000000
03000000000000000040400000000000020000000000000018000000000000001400000000000000
07000000000000001700000000000000c002400000000000feffff6f00000000a002400000000000
ffffff6f000000000100000000000000f0ffff6f0000000096024000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000b03e400000000000000000000000000000000000000000001610400000000000
000000000000000000000000000000000000000000000000010000000400f1ff0000000000000000
00000000000000000a00000001000b0000204000000000000600000000000000000000000400f1ff
000000000000000000000000000000000f00000001000d00b03e4000000000000000000000000000
1800000001000e00004040000000000000000000000000002e00000010000e002040400000000000
00000000000000003500000012000000000000000000000000000000000000004800000010000e00
204040000000000000000000000000005200000012000a0039104000000000000b00000000000000
4d00000010000e00204040000000000000000000000000005900000012000a002010400000000000
1900000000000000002e2f6d61696e2e63002e4c4331005f44594e414d4943005f474c4f42414c5f
4f46465345545f5441424c455f005f6564617461007072696e746640474c4942435f322e322e3500
5f656e64005f5f6273735f7374617274006d61696e00002e73796d746162002e737472746162002e
7368737472746162002e696e74657270002e676e752e68617368002e64796e73796d002e64796e73
7472002e676e752e76657273696f6e002e676e752e76657273696f6e5f72002e72656c612e706c74
002e74657874002e726f64617461002e65685f6672616d65002e64796e616d6963002e676f742e70
6c740000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000001b00000001000000
0200000000000000000240000000000000020000000000000f000000000000000000000000000000
01000000000000000000000000000000270000000500000002000000000000001002400000000000
10020000000000001400000000000000040000000000000008000000000000000400000000000000
23000000f6ffff6f0200000000000000280240000000000028020000000000001c00000000000000
0400000000000000080000000000000000000000000000002d0000000b0000000200000000000000
48024000000000004802000000000000300000000000000005000000010000000800000000000000
18000000000000003500000003000000020000000000000078024000000000007802000000000000
1e000000000000000000000000000000010000000000000000000000000000003d000000ffffff6f
02000000000000009602400000000000960200000000000004000000000000000400000000000000
020000000000000002000000000000004a000000feffff6f0200000000000000a002400000000000
a0020000000000002000000000000000050000000100000008000000000000000000000000000000
59000000040000004200000000000000c002400000000000c0020000000000001800000000000000
040000000e000000080000000000000018000000000000005e000000010000000600000000000000
00104000000000000010000000000000200000000000000000000000000000001000000000000000
10000000000000006300000001000000060000000000000020104000000000002010000000000000
24000000000000000000000000000000100000000000000000000000000000006900000001000000
02000000000000000020400000000000002000000000000006000000000000000000000000000000
10000000000000000000000000000000710000000100000002000000000000000820400000000000
08200000000000000000000000000000000000000000000008000000000000000000000000000000
7b000000060000000300000000000000b03e400000000000b02e0000000000005001000000000000
05000000000000000800000000000000100000000000000084000000010000000300000000000000
00404000000000000030000000000000200000000000000000000000000000000800000000000000
08000000000000000100000002000000000000000000000000000000000000002030000000000000
20010000000000001000000006000000080000000000000018000000000000000900000003000000
0000000000000000000000000000000040310000000000005e000000000000000000000000000000
01000000000000000000000000000000110000000300000000000000000000000000000000000000
9e310000000000008d00000000000000000000000000000001000000000000000000000000000000
rofl0r commented 2 years ago

_start is in your libc's startup files crt0.o etc. if the compiler was properly configured it should automatically add them when compiling things.

arteze commented 2 years ago

@rofl0r The file although it exists, the same still appears.

/usr/lib64/crt0.o 132 bytes

If I delete the file I follow with the same error.

rofl0r commented 2 years ago

your issue is not whether it exists or not, but whether it is added to the ld command that's used when linking your executable together. run your compiler command via strace to see what it ends up passing to ld.

arteze commented 2 years ago

The strace of lacc:

execve("../bin/lacc", ["../bin/lacc", "./main.c", "-o", "./main"], 0x7ffd0cc93328 /* 64 vars */) = 0
brk(NULL)                               = 0x1228000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64", 0x7fffe98d0c90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0;\0\0\0\0\0\0\0"..., 48, 848) = 48
pread64(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0", 32, 896) = 32
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=2173576, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8129ad0000
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1963304, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f81298f0000
mprotect(0x7f8129912000, 1765376, PROT_NONE) = 0
mmap(0x7f8129912000, 1433600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f8129912000
mmap(0x7f8129a70000, 327680, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f8129a70000
mmap(0x7f8129ac1000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d0000) = 0x7f8129ac1000
mmap(0x7f8129ac7000, 34088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8129ac7000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f81298ee000
arch_prctl(ARCH_SET_FS, 0x7f8129ad15c0) = 0
mprotect(0x7f8129ac1000, 16384, PROT_READ) = 0
mprotect(0x45c000, 4096, PROT_READ)     = 0
mprotect(0x7f8129b01000, 8192, PROT_READ) = 0
brk(NULL)                               = 0x1228000
brk(0x1249000)                          = 0x1249000
openat(AT_FDCWD, "./main.c", O_RDONLY)  = 3
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1076, ...}, AT_EMPTY_PATH) = 0
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1076, ...}, AT_EMPTY_PATH) = 0
read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
lseek(4, -614, SEEK_CUR)                = 410
read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 666
close(4)                                = 0
openat(AT_FDCWD, "main.o", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=107, ...}, AT_EMPTY_PATH) = 0
read(3, "extern int printf (const char *r"..., 4096) = 107
read(3, "", 4096)                       = 0
close(3)                                = 0
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_EMPTY_PATH) = 0
write(4, "\177ELF\2\1\1\0\0\0\20\0\0\0\0\0\1\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 1226) = 1226
close(4)                                = 0
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}, AT_EMPTY_PATH) = 0
write(1, "/usr/bin/ld -L/usr/local/lib -L/"..., 62/usr/bin/ld -L/usr/local/lib -L/usr/lib main.o -o ./main -lc 
) = 62
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f8129ad1890) = 28929
wait4(28929, /usr/bin/ld: aviso: no se puede encontrar el símbolo de entrada _start; se usa por defecto 0000000000401020
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28929
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28929, si_uid=0, si_status=0, si_utime=4, si_stime=1} ---
exit_group(0)                           = ?
+++ exited with 0 +++

The strace of ld

execve("/usr/bin/ld", ["/usr/bin/ld", "-L/usr/local/lib", "-L/usr/lib", "main.o", "-o", "./main", "-lc"], 0x7ffd2e310350 /* 64 vars */) = 0
brk(NULL)                               = 0x16e2000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/tls/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/tls", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib64", {st_mode=S_IFDIR|0755, st_size=860, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib64/tls/x86_64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/tls/x86_64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/tls/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/tls/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/tls/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/tls/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/tls/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/tls", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/x86_64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/x86_64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/x86_64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/x86_64", 0x7ffe640246d0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/libbfd-2.37-slack15.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0A\4\0\0\0\0\0"..., 832) = 832
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0\v\0\0\0\0\0\0\0"..., 48, 1277424) = 48
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1375240, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6600da2000
mmap(NULL, 1377944, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6600c51000
mprotect(0x7f6600c93000, 1011712, PROT_NONE) = 0
mmap(0x7f6600c93000, 761856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x42000) = 0x7f6600c93000
mmap(0x7f6600d4d000, 245760, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xfc000) = 0x7f6600d4d000
mmap(0x7f6600d8a000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x138000) = 0x7f6600d8a000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libctf.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/libctf.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PY\0\0\0\0\0\0"..., 832) = 832
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0\t\0\0\0\0\0\0\0"..., 48, 180080) = 48
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=187624, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 190784, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6600c22000
mprotect(0x7f6600c27000, 163840, PROT_NONE) = 0
mmap(0x7f6600c27000, 118784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f6600c27000
mmap(0x7f6600c44000, 40960, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6600c44000
mmap(0x7f6600c4f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c000) = 0x7f6600c4f000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\21\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=18680, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 16656, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6600c1d000
mmap(0x7f6600c1e000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6600c1e000
mmap(0x7f6600c1f000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6600c1f000
mmap(0x7f6600c20000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6600c20000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0;\0\0\0\0\0\0\0"..., 48, 848) = 48
pread64(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0", 32, 896) = 32
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=2173576, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1963304, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6600a3d000
mprotect(0x7f6600a5f000, 1765376, PROT_NONE) = 0
mmap(0x7f6600a5f000, 1433600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6600a5f000
mmap(0x7f6600bbd000, 327680, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f6600bbd000
mmap(0x7f6600c0e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d0000) = 0x7f6600c0e000
mmap(0x7f6600c14000, 34088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6600c14000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3602\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=100728, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 102784, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6600a23000
mprotect(0x7f6600a26000, 86016, PROT_NONE) = 0
mmap(0x7f6600a26000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f6600a26000
mmap(0x7f6600a34000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7f6600a34000
mmap(0x7f6600a3b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6600a3b000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6600a21000
arch_prctl(ARCH_SET_FS, 0x7f6600a22140) = 0
mprotect(0x7f6600c0e000, 16384, PROT_READ) = 0
mprotect(0x7f6600a3b000, 4096, PROT_READ) = 0
mprotect(0x7f6600c20000, 4096, PROT_READ) = 0
mprotect(0x7f6600d8a000, 86016, PROT_READ) = 0
mprotect(0x7f6600c4f000, 4096, PROT_READ) = 0
mprotect(0x560000, 24576, PROT_READ)    = 0
mprotect(0x7f6600dd3000, 8192, PROT_READ) = 0
getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=0}, ru_stime={tv_sec=0, tv_usec=3013}, ...}) = 0
brk(NULL)                               = 0x16e2000
brk(0x1703000)                          = 0x1703000
openat(AT_FDCWD, "/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=2998, ...}, AT_EMPTY_PATH) = 0
read(3, "# Locale name alias data base.\n#"..., 1024) = 1024
read(3, "und for the time being for\n# bac"..., 1024) = 1024
read(3, "859-1\ngalego\t\tgl_ES.ISO-8859-1\ng"..., 1024) = 950
read(3, "", 1024)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/locale/es_AR.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/locale/es_AR.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=38, ...}, AT_EMPTY_PATH) = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/locale/es_AR.utf8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=59, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 59, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6600a20000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=26988, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 26988, PROT_READ, MAP_SHARED, 3, 0) = 0x7f6600a19000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/locale/es_AR.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/locale/es_AR.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=346132, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 346132, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f66009c4000
close(3)                                = 0
openat(AT_FDCWD, "/usr/share/locale/es_AR.UTF-8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/es_AR.utf8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/es_AR/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/es.UTF-8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/es.utf8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/es/LC_MESSAGES/ld.mo", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=139556, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 139556, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f66009a1000
close(3)                                = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=4*1024}) = 0
newfstatat(AT_FDCWD, "./main", {st_mode=S_IFREG|0755, st_size=14000, ...}, 0) = 0
newfstatat(AT_FDCWD, "./main", {st_mode=S_IFREG|0755, st_size=14000, ...}, AT_SYMLINK_NOFOLLOW) = 0
unlink("./main")                        = 0
openat(AT_FDCWD, "./main", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
brk(0x1726000)                          = 0x1726000
openat(AT_FDCWD, "main.o", O_RDONLY)    = 4
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1226, ...}, AT_EMPTY_PATH) = 0
read(4, "\177ELF\2\1\1\0\0\0\20\0\0\0\0\0\1\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 1226
lseek(4, 0, SEEK_SET)                   = 0
read(4, "\177ELF\2\1\1\0\0\0\20\0\0\0\0\0\1\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1226, ...}, AT_EMPTY_PATH) = 0
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
openat(AT_FDCWD, "/usr/local/lib/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/x86_64-slackware-linux/lib64/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/x86_64-slackware-linux/lib64/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/libc.so", O_RDONLY) = 5
fcntl(5, F_GETFD)                       = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
brk(0x1748000)                          = 0x1748000
newfstatat(5, "", {st_mode=S_IFREG|0644, st_size=253, ...}, AT_EMPTY_PATH) = 0
read(5, "/* GNU ld script\n   Use the shar"..., 4096) = 253
lseek(5, 0, SEEK_SET)                   = 0
read(5, "/* GNU ld script\n   Use the shar"..., 4096) = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
brk(0x1740000)                          = 0x1740000
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
newfstatat(5, "", {st_mode=S_IFREG|0644, st_size=253, ...}, AT_EMPTY_PATH) = 0
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
openat(AT_FDCWD, "/usr/lib64/libc.so", O_RDONLY) = 6
ioctl(6, TCGETS, 0x7ffe64025070)        = -1 ENOTTY (Inappropriate ioctl for device)
newfstatat(6, "", {st_mode=S_IFREG|0644, st_size=253, ...}, AT_EMPTY_PATH) = 0
read(6, "/* GNU ld script\n   Use the shar"..., 8192) = 253
read(6, "", 4096)                       = 0
read(6, "", 8192)                       = 0
ioctl(6, TCGETS, 0x7ffe640250d0)        = -1 ENOTTY (Inappropriate ioctl for device)
close(6)                                = 0
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
lseek(5, 253, SEEK_SET)                 = 253
close(5)                                = 0
openat(AT_FDCWD, "/usr/lib64/libc.so", O_RDONLY) = 5
ioctl(5, TCGETS, 0x7ffe640251b0)        = -1 ENOTTY (Inappropriate ioctl for device)
newfstatat(5, "", {st_mode=S_IFREG|0644, st_size=253, ...}, AT_EMPTY_PATH) = 0
read(5, "/* GNU ld script\n   Use the shar"..., 8192) = 253
read(5, "", 4096)                       = 0
read(5, "", 8192)                       = 0
ioctl(5, TCGETS, 0x7ffe640236b0)        = -1 ENOTTY (Inappropriate ioctl for device)
close(5)                                = 0
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY) = 5
fcntl(5, F_GETFD)                       = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(5, "", {st_mode=S_IFREG|0755, st_size=2173576, ...}, AT_EMPTY_PATH) = 0
read(5, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 4096) = 4096
lseek(5, 0, SEEK_SET)                   = 0
read(5, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 4096) = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 4096, SEEK_SET)                = 4096
lseek(5, 2166784, SEEK_SET)             = 2166784
read(5, "ml\0__rpc_thread_svc_max_pollfd@G"..., 4096) = 4096
newfstatat(5, "", {st_mode=S_IFREG|0755, st_size=2173576, ...}, AT_EMPTY_PATH) = 0
lseek(5, 2170880, SEEK_SET)             = 2170880
read(5, "\0\0\0\0\0\0\0\0@\0\0\0\5\0\0\0\2\0\0\0\0\0\0\0\350\303\34\0\0\0\0\0"..., 4096) = 2696
lseek(5, 2166784, SEEK_SET)             = 2166784
read(5, "ml\0__rpc_thread_svc_max_pollfd@G"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0@\0\0\0\5\0\0\0\2\0\0\0\0\0\0\0\350\303\34\0\0\0\0\0"..., 4096) = 2696
lseek(5, 0, SEEK_SET)                   = 0
read(5, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 4096) = 4096
lseek(5, 2166784, SEEK_SET)             = 2166784
read(5, "ml\0__rpc_thread_svc_max_pollfd@G"..., 4096) = 4096
lseek(5, 0, SEEK_SET)                   = 0
read(5, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`A\2\0\0\0\0\0"..., 4096) = 4096
lseek(5, 1921024, SEEK_SET)             = 1921024
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1925120, SEEK_SET)             = 1925120
lseek(5, 1912832, SEEK_SET)             = 1912832
read(5, "@@\35\0\0\0\0\0\260u\21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(5, 73728, SEEK_SET)               = 73728
read(5, "|(\0\0\22\0\r\0\240(\t\0\0\0\0\0\221\0\0\0\0\0\0\0\360#\0\0\22\0\r\0"..., 4096) = 4096
brk(0x1761000)                          = 0x1761000
read(5, "hread_attr_getscope\0sigreturn\0__"..., 20480) = 20480
read(5, "locale\0svc_getreqset\0iopl\0__read"..., 4096) = 4096
lseek(5, 16384, SEEK_SET)               = 16384
read(5, "v\334\356\242\277\223h\371\213\t\7\20\27\322\364{\234\32\1^\250b\334M\277`y\360j\324\277\251"..., 4096) = 4096
read(5, "\340\304\3\0\0\0\0\0G\0\0\0\0\0\0\0\367-\0\0\"\0\r\0\220\373\3\0\0\0\0\0"..., 53248) = 53248
read(5, "|(\0\0\22\0\r\0\240(\t\0\0\0\0\0\221\0\0\0\0\0\0\0\360#\0\0\22\0\r\0"..., 4096) = 4096
brk(0x178d000)                          = 0x178d000
lseek(5, 102400, SEEK_SET)              = 102400
read(5, " \0\7\200\6\200\10\0\2\0\2\0\2\0\"\0\2\0\2\0\4\0\2\0\2\0\2\0\2\0\2\0"..., 4096) = 4096
lseek(5, 106496, SEEK_SET)              = 106496
lseek(5, 98304, SEEK_SET)               = 98304
read(5, "locale\0svc_getreqset\0iopl\0__read"..., 4096) = 4096
read(5, " \0\7\200\6\200\10\0\2\0\2\0\2\0\"\0\2\0\2\0\4\0\2\0\2\0\2\0\2\0\2\0"..., 4096) = 4096
brk(0x17ae000)                          = 0x17ae000
brk(0x17cf000)                          = 0x17cf000
brk(0x17f0000)                          = 0x17f0000
brk(0x1811000)                          = 0x1811000
brk(0x1836000)                          = 0x1836000
brk(0x1857000)                          = 0x1857000
brk(0x1878000)                          = 0x1878000
brk(0x1899000)                          = 0x1899000
brk(0x18ba000)                          = 0x18ba000
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6600980000
brk(0x18db000)                          = 0x18db000
sysinfo({uptime=9482, loads=[22208, 30848, 27648], totalram=1024086016, freeram=96632832, sharedram=53100544, bufferram=5582848, totalswap=1000083456, freeswap=772804608, procs=212, totalhigh=0, freehigh=0, mem_unit=1}) = 0
openat(AT_FDCWD, "/usr/lib64/libc_nonshared.a", O_RDONLY) = 6
fcntl(6, F_GETFD)                       = 0
fcntl(6, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(6, "", {st_mode=S_IFREG|0644, st_size=8694, ...}, AT_EMPTY_PATH) = 0
read(6, "!<arch>\n/               16292305"..., 4096) = 4096
lseek(6, -4088, SEEK_CUR)               = 8
read(6, "/               1629230586  0   "..., 4096) = 4096
newfstatat(6, "", {st_mode=S_IFREG|0644, st_size=8694, ...}, AT_EMPTY_PATH) = 0
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
lseek(6, 4104, SEEK_SET)                = 4104
openat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", O_RDONLY) = 7
fcntl(7, F_GETFD)                       = 0
fcntl(7, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(7, "", {st_mode=S_IFREG|0755, st_size=221768, ...}, AT_EMPTY_PATH) = 0
read(7, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(7, 0, SEEK_SET)                   = 0
read(7, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 217088, SEEK_SET)              = 217088
read(7, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
newfstatat(7, "", {st_mode=S_IFREG|0755, st_size=221768, ...}, AT_EMPTY_PATH) = 0
lseek(7, 221184, SEEK_SET)              = 221184
read(7, "\0\0\0\0\0\0\0\0\253\0\0\0\6\0\0\0\3\0\0\0\0\0\0\0p\16\3\0\0\0\0\0"..., 4096) = 584
lseek(7, 217088, SEEK_SET)              = 217088
read(7, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
read(7, "\0\0\0\0\0\0\0\0\253\0\0\0\6\0\0\0\3\0\0\0\0\0\0\0p\16\3\0\0\0\0\0"..., 4096) = 584
lseek(7, 0, SEEK_SET)                   = 0
read(7, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(7, 217088, SEEK_SET)              = 217088
read(7, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
lseek(7, 188416, SEEK_SET)              = 188416
read(7, "\16\30F\16\20A\16\10P\0\0\0L%\0\0\220\35\377\377\253\0\0\0\0K\16\20\215\2E\16"..., 4096) = 4096
lseek(7, 192512, SEEK_SET)              = 192512
read(7, "p!\1\0\0\0\0\0 7\1\0\0\0\0\0\0\301\0\0\0\0\0\0\200N\1\0\0\0\0\0"..., 4096) = 4096
lseek(7, 0, SEEK_SET)                   = 0
read(7, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
mmap(NULL, 1302528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6600842000
brk(0x18fc000)                          = 0x18fc000
munmap(0x7f6600842000, 1302528)         = 0
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
lseek(7, 4096, SEEK_SET)                = 4096
brk(0x1a36000)                          = 0x1a36000
openat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", O_RDONLY) = 8
fcntl(8, F_GETFD)                       = 0
fcntl(8, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(8, "", {st_mode=S_IFREG|0755, st_size=221768, ...}, AT_EMPTY_PATH) = 0
read(8, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(8, 217088, SEEK_SET)              = 217088
read(8, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
newfstatat(8, "", {st_mode=S_IFREG|0755, st_size=221768, ...}, AT_EMPTY_PATH) = 0
lseek(8, 221184, SEEK_SET)              = 221184
read(8, "\0\0\0\0\0\0\0\0\253\0\0\0\6\0\0\0\3\0\0\0\0\0\0\0p\16\3\0\0\0\0\0"..., 4096) = 584
lseek(8, 217088, SEEK_SET)              = 217088
read(8, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
read(8, "\0\0\0\0\0\0\0\0\253\0\0\0\6\0\0\0\3\0\0\0\0\0\0\0p\16\3\0\0\0\0\0"..., 4096) = 584
lseek(8, 0, SEEK_SET)                   = 0
read(8, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(8, 217088, SEEK_SET)              = 217088
read(8, "p_symbol_x\0__sigjmp_save\0_dl_clo"..., 4096) = 4096
lseek(8, 188416, SEEK_SET)              = 188416
read(8, "\16\30F\16\20A\16\10P\0\0\0L%\0\0\220\35\377\377\253\0\0\0\0K\16\20\215\2E\16"..., 4096) = 4096
newfstatat(8, "", {st_mode=S_IFREG|0755, st_size=221768, ...}, AT_EMPTY_PATH) = 0
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1226, ...}, AT_EMPTY_PATH) = 0
newfstatat(5, "", {st_mode=S_IFREG|0755, st_size=2173576, ...}, AT_EMPTY_PATH) = 0
newfstatat(6, "", {st_mode=S_IFREG|0644, st_size=8694, ...}, AT_EMPTY_PATH) = 0
lseek(8, 192512, SEEK_SET)              = 192512
read(8, "p!\1\0\0\0\0\0 7\1\0\0\0\0\0\0\301\0\0\0\0\0\0\200N\1\0\0\0\0\0"..., 4096) = 4096
lseek(8, 0, SEEK_SET)                   = 0
read(8, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 4096) = 4096
lseek(8, 4096, SEEK_SET)                = 4096
lseek(8, 4096, SEEK_SET)                = 4096
lseek(8, 4096, SEEK_SET)                = 4096
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
write(2, "/usr/bin/ld", 11/usr/bin/ld)             = 11
write(2, ": aviso: no se puede encontrar e"..., 54: aviso: no se puede encontrar el símbolo de entrada ) = 54
write(2, "_start", 6_start)                   = 6
write(2, "; se usa por defecto ", 21; se usa por defecto )   = 21
write(2, "0000000000401020", 160000000000401020)        = 16
write(2, "\n", 1
)                       = 1
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_EMPTY_PATH) = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "", 64)                         = 0
lseek(3, 64, SEEK_CUR)                  = 64
lseek(4, 1226, SEEK_SET)                = 1226
lseek(4, 1226, SEEK_SET)                = 1226
write(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0@\0\0\0\0\0@\0@\0\0\0\0\0"..., 448) = 448
lseek(3, 8192, SEEK_SET)                = 8192
write(3, "Hola\n\0", 6)                 = 6
lseek(3, 4096, SEEK_SET)                = 4096
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -4064, SEEK_CUR)               = 4128
write(3, "UH\211\345H\215=\325\17\0\0\270\0\0\0\0\350\333\377\377\3771\300\311\303", 25) = 25
lseek(3, 12288, SEEK_SET)               = 12288
read(3, "", 4096)                       = 0
lseek(3, 32, SEEK_CUR)                  = 12320
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\4\0\361\377"..., 382) = 382
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3584, SEEK_CUR)               = 512
write(3, "/lib/ld64.so.1\0", 15)        = 15
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3434, SEEK_CUR)               = 662
write(3, "\0\0\2\0", 4)                 = 4
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3424, SEEK_CUR)               = 672
write(3, "\1\0\1\0\10\0\0\0\20\0\0\0\0\0\0\0u\32i\t\0\0\2\0\22\0\0\0\0\0\0\0", 32) = 32
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3512, SEEK_CUR)               = 584
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\22\0\0\0"..., 78) = 78
lseek(3, 8192, SEEK_SET)                = 8192
read(3, "Hola\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -336, SEEK_CUR)                = 11952
write(3, "\1\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\20\2@\0\0\0\0\0"..., 336) = 336
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3568, SEEK_CUR)               = 528
write(3, "\1\0\0\0\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0", 20) = 20
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3544, SEEK_CUR)               = 552
write(3, "\1\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 28) = 28
lseek(3, 4096, SEEK_SET)                = 4096
write(3, "\3775\0020\0\0\377%\0040\0\0\17\37@\0\377%\0020\0\0h\0\0\0\0\351\340\377\377\377", 32) = 32
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
lseek(3, -3392, SEEK_CUR)               = 704
write(3, "\30@@\0\0\0\0\0\7\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0", 24) = 24
lseek(3, 12288, SEEK_SET)               = 12288
write(3, "\260>@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26\20@\0\0\0\0\0", 32) = 32
lseek(3, 12288, SEEK_SET)               = 12288
read(3, "\260>@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26\20@\0\0\0\0\0"..., 4096) = 414
write(3, "\0.symtab\0.strtab\0.shstrtab\0.inte"..., 141) = 141
lseek(3, 0, SEEK_SET)                   = 0
write(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\2\0>\0\1\0\0\0 \20@\0\0\0\0\0"..., 64) = 64
lseek(3, 12288, SEEK_SET)               = 12288
read(3, "\260>@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26\20@\0\0\0\0\0"..., 4096) = 555
lseek(3, 5, SEEK_CUR)                   = 12848
munmap(0x7f6600980000, 135168)          = 0
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1152) = 1152
close(3)                                = 0
newfstatat(AT_FDCWD, "./main", {st_mode=S_IFREG|0644, st_size=14000, ...}, 0) = 0
umask(000)                              = 022
umask(022)                              = 000
chmod("./main", 0755)                   = 0
close(4)                                = 0
close(8)                                = 0
close(6)                                = 0
close(5)                                = 0
close(7)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++
rofl0r commented 2 years ago

the only lines relevant are the ones containing execve. as you can see lacc, doesn't add any startfiles (crt*.o) to the linker command, that's why _start isnt found. output from gcc:

$ strace -f gcc main.c 2>&1 | grep execve | grep ld
[pid 27784] execve("/opt/gcc650/bin/../libexec/gcc/x86_64-unknown-linux-musl/6.5.0/collect2", ["/opt/gcc650/bin/../libexec/gcc/x"..., "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "/lib/crt1.o", "/lib/crti.o", "/opt/gcc650/bin/../lib/gcc/x86_6"..., "-L/opt/gcc650/bin/../lib/gcc/x86"..., "-L/opt/gcc650/bin/../lib/gcc", "-L/opt/gcc650/bin/../lib/gcc/x86"..., "-L/opt/gcc650/bin/../lib/gcc/x86"..., "/tmp/ccPgACfn.o", "-lgcc", "--as-needed", ...], [/* 29 vars */] <unfinished ...>
[pid 27785] execve("/bin/ld", ["/bin/ld", "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "/lib/crt1.o", "/lib/crti.o", "/opt/gcc650/bin/../lib/gcc/x86_6"..., "-L/opt/gcc650/bin/../lib/gcc/x86"..., "-L/opt/gcc650/bin/../lib/gcc", "-L/opt/gcc650/bin/../lib/gcc/x86"..., "-L/opt/gcc650/bin/../lib/gcc/x86"..., "/tmp/ccPgACfn.o", "-lgcc", "--as-needed", ...], [/* 29 vars */] <unfinished ...>
arteze commented 2 years ago

When I add the parameter --dynamic-linker, the same warning is still happening.

/usr/bin/ld --as-needed -m elf_x86_64 -L/usr/local/lib -L/usr/lib main.o -lc --dynamic-linker /usr/lib64/crt0.o --eh-frame-hdr -o ./main

/usr/bin/ld: aviso: no se puede encontrar el símbolo de entrada _start; se usa por defecto 0000000000401020
nicebub commented 2 years ago

correct me if Im wrong, but I think this was supposed to be during your ./configure stage setup. Have you tried uninstalling, doing a make clean and another ./configure with the appropriate directory settings for your distribution?

rofl0r commented 2 years ago

When I add the parameter --dynamic-linker, the same warning is still happening.

not what i was talking about. look at what crt* is added by your gcc.

I think this was supposed to be during your ./configure stage setup

precisely what i think too.

arteze commented 2 years ago

If I do strace to gcc, The result is as follows:

> strace -f gcc ./main.c -o ./ma 2>&1 | grep -i execve | grep -i ld

[pid 24196] execve("/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/collect2", ["/usr/libexec/gcc/x86_64-slackwar"..., "-plugin", "/usr/libexec/gcc/x86_64-slackwar"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "./ma", "/usr/lib64/gcc/x86_64-slackware-"..., "/usr/lib64/gcc/x86_64-slackware-"..., "/usr/lib64/gcc/x86_64-slackware-"..., "-L/usr/lib64/gcc/x86_64-slackwar"..., "-L/usr/lib64/gcc/x86_64-slackwar"..., "-L/lib/../lib64", "-L/usr/lib/../lib64", "-L/usr/lib64/gcc/x86_64-slackwar"..., "/tmp/cc737V0e.o", "-lgcc", "--push-state", "--as-needed", "-lgcc_s", "--pop-state", "-lc", ...], 0x247d600 /* 69 vars */ <unfinished ...>
[pid 24197] execve("/usr/bin/ld", ["/usr/bin/ld", "-plugin", "/usr/libexec/gcc/x86_64-slackwar"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "./ma", "/usr/lib64/gcc/x86_64-slackware-"..., "/usr/lib64/gcc/x86_64-slackware-"..., "/usr/lib64/gcc/x86_64-slackware-"..., "-L/usr/lib64/gcc/x86_64-slackwar"..., "-L/usr/lib64/gcc/x86_64-slackwar"..., "-L/lib/../lib64", "-L/usr/lib/../lib64", "-L/usr/lib64/gcc/x86_64-slackwar"..., "/tmp/cc737V0e.o", "-lgcc", "--push-state", "--as-needed", "-lgcc_s", "--pop-state", "-lc", ...], 0x7ffded0ac3c8 /* 69 vars */ <unfinished ...>
rofl0r commented 2 years ago

you need -s 256 -v args to strace to see the crt stuff, as its cutting them off.

arteze commented 2 years ago

With the routes without abbreviation.

[pid 26624] execve("/usr/bin/ld", ["/usr/bin/ld", "-plugin", "/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/liblto_plugin.so", "-plugin-opt=/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/lto-wrapper", "-plugin-opt=-fresolution=/tmp/ccrH2JxL.res", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_s", "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_s", "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "./main", "/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../lib64/crt1.o", "/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../lib64/crti.o", "/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbegin.o", "-L/usr/lib64/gcc/x86_64-slackware-linux/11.2.0", "-L/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../lib64", "-L/lib/../lib64", "-L/usr/lib/../lib64", "-L/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../..", "/tmp/ccrUaZSC.o", "-lgcc", "--push-state", "--as-needed", "-lgcc_s", "--pop-state", "-lc", "-lgcc", "--push-state", "--as-needed", "-lgcc_s", "--pop-state", "/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtend.o", "/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../lib64/crtn.o"], ["SHELL=/bin/bash", "DEFAULTWORDPROCESSOR=/usr/local/bin/defaultwordprocessor", "XDG_CONFIG_DIRS=/etc/xdg", "HISTCONTROL=ignoredups", "DEFAULTPAINT=/usr/local/bin/defaultpaint", "XDG_MENU_PREFIX=lxde-", "G_BROKEN_FILENAMES=1", "HISTSIZE=1000", "HOSTNAME=puppypc22006", "PREFIX=/usr", "_LXSESSION_PID=4809", "XDG_DATA_HOME=/root/.local/share", "XDG_CONFIG_HOME=/root/.config", "DESKTOP_SESSION=LXDE", "NO_AT_BRIDGE=1", "EDITOR=nano", "PWD=/root/Downloads/lacc/pruebas", "LOGNAME=root", "DEFAULTSPREADSHEET=/usr/local/bin/defaultspreadsheet", "DEFAULTDRAW=/usr/local/bin/defaultdraw", "DEFAULTIMAGEVIEWER=/usr/local/bin/defaultimageviewer", "WINDOWPATH=3", "GTK2_RC_FILES=/root/.gtkrc-2.0", "HOME=/root", "LANG=es_AR.UTF-8", "XFINANSDIR=/root/.xfinans", "LS_COLORS=bd=33:cd=33", "XDG_CURRENT_DESKTOP=LXDE", "RGBDEF=/usr/share/X11/rgb.txt", "G_SLICE=always_malloc", "GIO_EXTRA_MODULES=/usr/lib64/gio/modules/", "GTKDIALOG_BUILD=GTK2", "DEFAULTTEXTEDITOR=/usr/local/bin/defaulttexteditor", "XDG_CACHE_HOME=/root/.cache", "DEFAULTMEDIAPLAYER=/usr/local/bin/defaultmediaplayer", "TERM=xterm", "TERMINFO=/usr/share/terminfo", "G_FILENAME_ENCODING=@locale", "USER=root", "GDK_USE_XFT=1", "DISPLAY=:0", "SHLVL=3", "INPUTRC=/etc/inputrc", "XLIB_SKIP_ARGB_VISUALS=1", "PAGER=less", "DEFAULTBROWSER=/usr/local/bin/defaultbrowser", "OOO_FORCE_DESKTOP=gnome", "DEFAULTIMAGEEDITOR=/usr/local/bin/defaultimageeditor", "LD_LIBRARY_PATH=/lib64:/usr/lib64:/root/my-applications/lib:/usr/local/lib:/mnt/sda4/a/lib", "XDG_RUNTIME_DIR=/tmp/runtime-root", "PS1=\\[\\e[1;32m\\]\\w\\[\\e[0m\\]\\n", "MM_RUNASROOT=1", "QT_XFT=true", "XDG_DATA_DIRS=/usr/share:/usr/local/share", "BROWSER=/usr/local/bin/defaultbrowser", "PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/my-applications/bin:/usr/games:/mnt/sda4/a/bin", "DEFAULTHTMLEDITOR=/usr/local/bin/defaulthtmleditor", "HISTFILESIZE=2000", "SAL_USE_VCLPLUGIN=gtk", "DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Ro6sF2pW1n,guid=c1380ca36026a4deb6bf273161cb74eb", "OUTPUT_CHARSET=UTF-8", "OLDPWD=/root/Downloads", "TEXTDOMAIN=xwin", "_=/usr/bin/strace", "COLLECT_GCC=gcc", "COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/lto-wrapper", "COLLECT_GCC_OPTIONS='-o' './main' '-mtune=generic' '-march=x86-64' '-dumpdir' './main.'", "COMPILER_PATH=/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/:/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/:/usr/libexec/gcc/x86_64-slackware-linux/:/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/:/usr/lib64/gcc/x86_64-slackware-linux/:/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../x86_64-slackware-linux/bin/", "LIBRARY_PATH=/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/:/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/../../../:/lib/:/usr/lib/"] <unfinished ...>

arteze commented 2 years ago

When I try to do it manually, I have these errors:

ld -L/usr/local/lib -L/usr/lib main.o -o ./main -lc /usr/lib64/crt1.o /usr/lib64/crti.o /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbegin.o /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtend.o /usr/lib64/crtn.o
ld: /usr/lib64/crt1.o: en la función `_start':
/tmp/glibc-2.33/csu/../sysdeps/x86_64/start.S:107: referencia a `__libc_csu_fini' sin definir
ld: /tmp/glibc-2.33/csu/../sysdeps/x86_64/start.S:108: referencia a `__libc_csu_init' sin definir
arteze commented 2 years ago

I was able to solve it as follows:

ld -o ./main -dynamic-linker /lib64/ld-2.33.so /usr/lib64/crt1.o /usr/lib64/crti.o -lc /usr/lib64/crtn.o main.o

nicebub commented 2 years ago

When I try to do it manually, I have these errors:

ld -L/usr/local/lib -L/usr/lib main.o -o ./main -lc /usr/lib64/crt1.o /usr/lib64/crti.o /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbegin.o /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtend.o /usr/lib64/crtn.o
ld: /usr/lib64/crt1.o: en la función `_start':
/tmp/glibc-2.33/csu/../sysdeps/x86_64/start.S:107: referencia a `__libc_csu_fini' sin definir
ld: /tmp/glibc-2.33/csu/../sysdeps/x86_64/start.S:108: referencia a `__libc_csu_init' sin definir

I think the order in which you add the libraries, especially crtbegin.o and crtend.o make a difference in reference to '-lc' I think thats the right one. so you must have ....... ../crtbegin.o -lc .... crtend.o. You can't just group them all up in the end as the files are read in order usually. So libc_csu_fini and libc__csu_init are declared after they are referenced from -lc, I believe. But this doesn't really solve your issue.

nicebub commented 2 years ago

I was able to solve it as follows:

ld -o ./main -dynamic-linker /lib64/ld-2.33.so /usr/lib64/crt1.o /usr/lib64/crti.o -lc /usr/lib64/crtn.o main.o

After reading all of your straces and messages, it seems that you are always trying to add -L/usr/lib and -L/usr/local/lib, but isn't this 64bit which all of your libraries can be found in /usr/lib64/.

Do you have a hybrid system with 32bit and 64bit libraries, compilers, binutils, and such?

Could either of these things be the problem as the compiler is looking for 64bit versions of things but is only being pointed to 32bit, or vice versa ?

arteze commented 2 years ago

Yes, it should be by that, I'm using PuppyLinux LxPupSc64, Slackware.

uname -a -> Linux puppypc22006 5.11.11-lxpup64 #1 SMP Tue Mar 30 15:47:34 BST 2021 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

nicebub commented 2 years ago

What did you use as options during your ./configure stage?

I am on OS X 10.12.6

I can reproduce a similar error from the source directory, after building, somewhat.

I did not install and used the ./configure --libdir=lib/ option.

with your test file I get: Undefined symbols for architecture x86_64: "start", referenced from: implicit entry/start for main executable ld: symbol(s) not found for inferred architecture x86_64

arteze commented 2 years ago

What I did was run configure (of lacc), without parameters, I got the following warning:

./configure
warning: Host x86_64-slackware-linux is not recognized.

The structure of the system directories is as follows:

ls / | grep ""
bin
boot
dcs
dev
doc
etc
home
include
initrd
install
lib
lib64
man
media
mnt
opt
proc
root
run
sbin
share
sys
system
tmp
usr
var

List of libraries in usr/lib:

find /usr/lib -name *.so*
/usr/lib/dhcpcd/dev/udev.so
/usr/lib/ladspa/caps.so
/usr/lib/libgee-0.8.so.2
/usr/lib/libgee-0.8.so.2.6.1
/usr/lib/libgphoto2.so
/usr/lib/libgphoto2.so.2
/usr/lib/libgphoto2.so.6
/usr/lib/libgphoto2.so.6.0.0
/usr/lib/libgphoto2_port.so
/usr/lib/libgphoto2_port.so.0
/usr/lib/libgphoto2_port.so.10
/usr/lib/libgphoto2_port.so.12
/usr/lib/libgphoto2_port.so.12.0.0
/usr/lib/libjpeg.so.62
/usr/lib/libncurses.so.5
/usr/lib/libomptarget.rtl.amdgpu.so
/usr/lib/libpupvm.so.0
/usr/lib/libreadline.so.6
/usr/lib/libtinfo.so.6
/usr/lib/libtinfo.so.6.2
/usr/lib/sylpheed/plugins/attachment_tool.so
/usr/lib/sylpheed/plugins/test.so

List of libraries in usr/local/lib:

find /usr/local/lib -name "*.so*"
/usr/local/lib/light/browser/components/libbrowsercomps.so
/usr/local/lib/light/libfreeblpriv3.so
/usr/local/lib/light/liblgpllibs.so
/usr/local/lib/light/libmozsqlite3.so
/usr/local/lib/light/libnspr4.so
/usr/local/lib/light/libnss3.so
/usr/local/lib/light/libnssckbi.so
/usr/local/lib/light/libnssutil3.so
/usr/local/lib/light/libplc4.so
/usr/local/lib/light/libplds4.so
/usr/local/lib/light/libsmime3.so
/usr/local/lib/light/libsoftokn3.so
/usr/local/lib/light/libssl3.so
/usr/local/lib/light/libxul.so
/usr/local/lib/installwatch.so
nicebub commented 2 years ago

what about your libraries in /usr/lib64?

nicebub commented 2 years ago

what would happen if you ran ./configure --host=x86_64-linux-gnu and then make and try your file again?

if this doesn't work maybe try ./configure --host=x86_64-linux-gnu --libdir=lib/

read the configure script in the main source directory for reasoning and rationale

arteze commented 2 years ago

I solved it as follows:

./configure --host=x86_64-pc-linux-gnu
make
make install
ln -svf /usr/lib64 /usr/lib/x86_64-linux-gnu
ln -svf /lib64 /lib/x86_64-linux-gnu

Now when I compile with lacc works well, and executes correctly:

extern int printf (const char *restrict __format, ...);
int main() {
    printf("Hi\n");
    return 0;
}

When compiling:

lacc ./main.c -o ./main
/usr/bin/ld -e _start -dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /usr/lib/x86_64-linux-gnu/Scrt1.o /usr/lib/x86_64-linux-gnu/crti.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L/usr/lib main.o -o ./main -lc /usr/lib/x86_64-linux-gnu/crtn.o 

When executing:

Hi

List of files *.o in /usr/lib64:

find /usr/lib64 -name "*.o"
/usr/lib64/Mcrt1.o
/usr/lib64/Scrt1.o
/usr/lib64/bcc/crt0.o
/usr/lib64/bcc/i386/crt0.o
/usr/lib64/crt1.o
/usr/lib64/crti.o
/usr/lib64/crtn.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbegin.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbeginS.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtbeginT.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtend.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtendS.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtfastmath.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtprec32.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtprec64.o
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/crtprec80.o
/usr/lib64/gcrt1.o
/usr/lib64/libasan_preinit.o
/usr/lib64/liblsan_preinit.o
/usr/lib64/libtsan_preinit.o
nicebub commented 2 years ago

Here are some hardcoded paths that will be compiled into the binary when using: ./configure --host=x86_64-pc-linux-gnu

GLIBC is defined in the configure script, and a few other defines, when you use --host=x86_64-pc-linux-gnu:

    echo '#define UNIX 1' >> config.h
    echo '#define LINUX 1' >> config.h
    echo '#define GLIBC 1' >> config.h
    includepaths="\"/usr/local/include\", \"/usr/include/${host}\", \"/usr/include\""

in the src/backend/linker.c file you find other hardcoded paths currently:

 #elif GLIBC
if (!is_shared) {
    add_option(&ld_args, "-e");
    add_option(&ld_args, "_start");
    add_option(&ld_args, "-dynamic-linker");
    add_option(&ld_args, "/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2");
    if (context.pic) {
        add_option(&ld_args, "/usr/lib/x86_64-linux-gnu/Scrt1.o");
    } else {
        add_option(&ld_args, "/usr/lib/x86_64-linux-gnu/crt1.o");
    }
}

add_option(&ld_args, "/usr/lib/x86_64-linux-gnu/crti.o");
add_option(&ld_args, "-L/usr/lib/x86_64-linux-gnu");

so if you don't have any of these in the same paths, then the system linker may not be able to link properly as you've seen before. But the system linker may be able to discard these options and use other system defaults if it were smart enough.

Using LD_LIBRARY_PATH perhaps??

Otherwise: lacc could potentially be changed to take search, find, or be configured to find system specific directories and files so that it isn't hardcoded.

Of course making symbolic links like you have done could also be quick and easy fix, if it solves all of your problems before @larmel or anyone else makes the appropriate changes.

arteze commented 2 years ago

Perfect, now is better, I made the changes in configure and in linker.c:

lacc ./main.c -o ./main
/usr/bin/ld -e _start -dynamic-linker /lib64/ld-2.33.so /usr/lib64/Scrt1.o /usr/lib64/crti.o -L/usr/lib64 -L/usr/local/lib -L/usr/lib main.o -o ./main -lc /usr/lib64/crtn.o 

With that, execute correctly.