Hi!
I've built and installed GNU ARM tools on my Fedora 6 x86_64 machine.
I fail to link a simple program and I haven't got the faintest as to why.
I give you a full trace of my actions including how I built my ARM tool chain.
If you can find something I'd really appreciate that!
Thank you in advance
/Sune
PS I'll cross post this to the chat lounge as well....
This is how I built my arm tools
===========================================
It's pretty much straight from
http://www.gnuarm.com/
binutils
----------
../binutils-2.17/configure --target=arm-elf --prefix=/usr/local/ARMv5TE --enable-interwork --enable-multilib
make all install
export PATH="$PATH:/usr/local/ARMv5TE/bin"
GCC
----------
../gcc-4.1.1/configure --target=arm-elf --prefix=/usr/local/ARMv5TE --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=../../newlib/src/newlib/libc/include/
make all-gcc install-gcc
newlib
----------
../src/configure --target=arm-elf --prefix=/usr/local/ARMv5TE --enable-interwork --enable-multilib
make all install
GCC
----------
make all install
GDB
----------
../gdb-6.8/configure --target=arm-elf --prefix=/usr/local/ARMv5TE --enable-interwork --enable-multilib
make all install
This is how I compile my simple LED example
=============================================
arm-elf-gcc -mcpu=xscale -g -c -Wall -I../include ../led.c
I've tried without -mcpu=xscale as well with the same error.
This is my program
=============================================
led.h:
#ifndef LED_H_
#define LED_H_
#include <stdint.h>
// Define address of GPDR0, the direction register for GPIO 0..31
#define GPIO_0_DIR_REG (*((uint32_t volatile*)0x40E0000C))
// Define the address of GPSR0, the SET register for GPIO 0..31
#define GPIO_0_SET_REG (*((uint32_t volatile*)0x40E00018))
// Define the address of GPCR0, the CLEAR register for GPIO 0..31
#define GPIO_0_CLR_REG (*((uint32_t volatile*)0x40E00024))
// Define the address of GPLR0, the LEVEL register for GPIO 0..31
#define GPIO_0_LVL_REG (*((uint32_t volatile*)0x40E00000))
// LED_GREEN Identifies GPIO22
#define LED_GREEN (0x00400000)
// Define address of GAFR0_U, the ALTERNATE function register for GPIO
// 16..31
#define GPIO_0_ALT_REG (*((uint32_t volatile*)0x40E00058))
// Set function for GPIO
#define LED_GREEN_GPIO22_NORMAL_FUNCTION (0xFFFFCFFF)
#endif /*LED_H_*/
led.c:
#include "led.h"
void led_init()
{
// Set GPIO22 low before configuring it
GPIO_0_CLR_REG = LED_GREEN;
// Disable alternate functions of GPIO22
GPIO_0_ALT_REG &= LED_GREEN_GPIO22_NORMAL_FUNCTION;
// Set direction OUT since it’s a LED
GPIO_0_DIR_REG |= LED_GREEN;
}
void delay1s()
{
uint16_t rounds = 18000;
while (rounds--)
{}
}
void led_toggle()
{
if (GPIO_0_LVL_REG & LED_GREEN)
GPIO_0_CLR_REG = LED_GREEN;
else
GPIO_0_SET_REG = LED_GREEN;
}
int main(int argc, char** argv)
{
led_init();
while (1)
{
led_toggle();
delay1s();
}
return 0;
}
This is where it fails
=============================================
link command
---------------
arm-elf-ld -Map led.map -T viperlite.ld -No led led.o
link error
---------------
arm-elf-ld: error: no memory region specified for loadable section `.glue_7'
link script (viperlite.ld)
---------------
ENTRY (main)
MEMORY
{
ram : ORIGIN = 0x00400000, LENGTH = 64M
rom : ORIGIN = 0x60000000, LENGTH = 16M
}
SECTIONS
{
data : /* Initialized data. */
{
_DataStart = . ;
*(.data)
_DataEnd = . ;
} >ram
bss : /* Uninitialized data. */
{
_BssStart = . ;
*(.bss)
_BssEnd = . ;
} >ram
text : /* The actual instructions. */
{
*(.text)
} >ram
}