LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   Arm cross-compiler (https://www.linuxquestions.org/questions/slackware-arm-108/arm-cross-compiler-4175538228/)

turboscrew 03-30-2015 07:23 AM

Arm cross-compiler
 
Are there many RPi bare metal programmers?

I wonder if there is a well-working GNU toolchain neatly packaged for Slackware?

I'm using eclipse CDT (Kepler) if that has any meaning.

I've tried the Raspbian official tool chain and
Code:

bash-4.2$ ./arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(How to tell which toolchain is which?)
I think both of them are Linaro-toolchains, but I'm not sure.
Both of them, however, seem to have the same oddities with linking.
- in linker script, file names need to have wildcard before extension in the input section definitions.
- unable to find symbols (asm - c)
- maybe something else I haven't encountered yet

Or maybe someone knows how to make the mentioned toolchains work?

The first problem:
Code:

    .text :
    {
        start.o(.text)
    }

would cause "multiple definition of `_start'" where the _start is the label (declared 'globl') for start-up code in the start.S, and defined "ENTRY(_start)".

This works:
Code:

    .text :
    {
        start*.o(.text)
    }

The second (yet unsolved problem) is that in start.S there is a call
Code:

ldr pc, =_start1
and in a c-file
Code:

void start1()
{
...
}

and I'm getting
Quote:

undefined reference to `_start1'
no matter if I declare '_start1' as .extern in the start.S or not.
Also linking order of the C- and S-file doesn't make a difference.

turboscrew 03-30-2015 12:01 PM

WHAT?
It seems there are no added underscore in the c-names.
If I replace
Code:

ldr pc, =_start1
with
Code:

ldr pc, =start1
, it works! =-O

What the <censored> has happened to GCC? Are those ARM-only features?


All times are GMT -5. The time now is 07:30 PM.