NetBSD-Bugs archive

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

Re: port-arm32/50218: ARM executables linked with native linker on cortex-a9 raises SIGILL



> Are you building from a single c source, or from libs?
> My bet is the swapping happens fine for c source or "normal" objects,
> but you are using some lib that has been partially stripped, which kills
> the $t/$a markers. libgcc was one of those libraries (untill fixed)

I have compiled 1 file. 
gcc -o api.o -DHAVE_CONFIG_H  -I. -I.. -I../include  -c  api.c

Now I have written a simple C function which calls only one function from the objs.

gcc -o test2 -DHAVE_CONFIG_H  -I. -I.. -I../include test1.c api.o

# ./test2
pid 447 (test2), uid 0: exited on signal 4 (core not dumped, err = 2)
[1]   Illegal instruction     ./test2

# gcc -o api.o -DHAVE_CONFIG_H  -I. -I.. -I../include  -c  api.c
# gcc -o test2 -DHAVE_CONFIG_H  -I. -I.. -I../include test1.c api.o
# ./test2
#                                                

The content of the test1.c is always the same.

# cat test1.c
#include <yaml.h>

int main ()
{
  yaml_parser_t parser;
  yaml_parser_initialize (&parser);
return 0;
}

The obj is correctly endianness swapped in the latter case. Wonder why the same function crashes in one case and not the other.




On Tue, Sep 8, 2015 at 12:30 PM, Martin Husemann <martin%duskware.de@localhost> wrote:
The following reply was made to PR port-arm32/50218; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: Zaid Ibrahime <mzaidibrahime%gmail.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: port-arm32/50218: ARM executables linked with native linker on cortex-a9 raises SIGILL
Date: Tue, 8 Sep 2015 08:58:29 +0200

 On Tue, Sep 08, 2015 at 11:12:40AM +0530, Zaid Ibrahime wrote:
 >  > Small programs(<6K size) does not result in SIGILL as all the
 > instruction are properly swapped for endianness by the linker.
 >
 >  > Are you sure that it depends on size of the program?

 Are you building from a single c source, or from libs?
 My bet is the swapping happens fine for c source or "normal" objects,
 but you are using some lib that has been partially stripped, which kills
 the $t/$a markers. libgcc was one of those libraries (untill fixed)

 Martin




Home | Main Index | Thread Index | Old Index