tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] TinyCC crashes when loading /usr/lib/crt1.o


From: Barath Aron
Subject: [Tinycc-devel] TinyCC crashes when loading /usr/lib/crt1.o
Date: Mon, 3 Dec 2018 17:34:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Hello,

I experienced a crash when I tried to compile a hello world on ARM.

uname: Linux alarm 4.18.13-1-ARCH #1 SMP PREEMPT Thu Oct 11 02:22:56 UTC 2018 armv7l GNU/Linux

I compiled a fresh tcc (because the tcc in the official package crashed as well), and I've run with gdb:

Starting program: /tmp/tcc/tinycc/tcc a.c

Program received signal SIGSEGV, Segmentation fault.
0x00421924 in tcc_load_object_file (s1=0x45a090, address@hidden,
    fd=4562736, address@hidden, file_offset=4563592, address@hidden)
    at tccelf.c:2465
2465                s->sh_info = sm_table[sh->sh_info].s->sh_num;
(gdb) where
#0  0x00421924 in tcc_load_object_file (s1=0x45a090, address@hidden,
    fd=4562736, address@hidden, file_offset=4563592, address@hidden)
    at tccelf.c:2465
#1  0x00404174 in tcc_add_file_internal (s1=0x454150,
    filename=0xbefff5bc "/usr/lib/crt1.o", flags=64) at libtcc.c:1026
#2  0x00404268 in tcc_add_library_internal (address@hidden,
    fmt=0x42d6cc "%s/%s", address@hidden "crt1.o",
    address@hidden, paths=0x457838, nb_paths=1) at libtcc.c:1105
#3  0x004043ec in tcc_add_crt (address@hidden, filename=0x42d740 "crt1.o")
    at libtcc.c:1121
#4  0x00404524 in tcc_set_output_type (s=0x454150, output_type=2)
    at libtcc.c:976
#5  0x00401538 in main (argc0=<optimized out>, argv0=<optimized out>)
    at tcc.c:317
(gdb) p *sh
$1 = {sh_name = 75, sh_type = 9, sh_flags = 64, sh_addr = 0, sh_offset = 1040,
  sh_size = 8, sh_link = 13, sh_info = 6, sh_addralign = 4, sh_entsize = 8}
(gdb) p sm_table[sh->sh_info]
$2 = {s = 0x4, offset = 0, new_section = 45 '-', link_once = 0 '\000'}


Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al   [ 0]                   NULL            00000000 000000 000000 00      0   0  0   [ 1] .note.ABI-tag     NOTE            00000000 000034 000020 00 A  0   0  4   [ 2] .text             PROGBITS        00000000 000054 000058 00 AX  0   0  4   [ 3] .rel.text         REL             00000000 0003e0 000030 08 I 13   2  4   [ 4] .rodata.cst4      PROGBITS        00000000 0000ac 000004 04 AM  0   0  4   [ 5] .ARM.extab        PROGBITS        00000000 0000b0 000000 00 A  0   0  1   [ 6] .ARM.exidx        ARM_EXIDX       00000000 0000b0 000008 00 AL  2   0  4   [ 7] .rel.ARM.exidx    REL             00000000 000410 000008 08 I 13   6  4   [ 8] .data             PROGBITS        00000000 0000b8 000004 00 WA  0   0  1   [ 9] .bss              NOBITS          00000000 0000bc 000000 00 WA  0   0  1   [10] .comment          PROGBITS        00000000 0000bc 000024 01 MS  0   0  1   [11] .note.GNU-stack   PROGBITS        00000000 0000e0 000000 00      0   0  1   [12] .ARM.attributes   ARM_ATTRIBUTES  00000000 0000e0 000033 00      0   0  1   [13] .symtab           SYMTAB          00000000 000114 0001f0 10     14  21  4   [14] .strtab           STRTAB          00000000 000304 0000dc 00      0   0  1   [15] .shstrtab         STRTAB          00000000 000418 00008e 00      0   0  1

The section which caused the crash was "[ 7] .rel.ARM.exidx". It seems tcc cannot handle something. Can you look into it?

Aron




reply via email to

[Prev in Thread] Current Thread [Next in Thread]