t-kernel team mailing list archive
-
t-kernel team
-
Mailing list archive
-
Message #00232
Re: RTEMS Linker
On Mon, Apr 25, 2016 at 11:57:04AM +0200, Sw-Hw Eng wrote:
> Hello,
Hi, I am new to RTEMS, allow try to answer this question,
please correct me if i am wrong. :D
>
> I'm working on RTEMS on xilinx zynq.
> The rtems apps included in test suites have as entry point address
> 0x104040. I'm wondering if I can't change that.
> I checked the linkcmds.in but I'm not sure how can I change the entry
> address and the RAM size.
> Can you please tell how can I do that ?
there is a file:
rtems/c/src/lib/libbsp/arm/xilinx-zynq/make/custom/xilinx_zynq.inc
- - -
include $(RTEMS_ROOT)/make/custom/default.cfg
RTEMS_CPU = arm
CPU_CFLAGS = -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9
CFLAGS_OPTIMIZE_V ?= -O2 -g
CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
LDFLAGS = -Wl,--gc-sections
- - -
How about add a option -T0x00104040
LDFLAGS = -Wl,--gc-sections,-T0x00104040
this will link your image at 0x00104040, and you have to place
your entry point(maybe _start) at the beginning of the text.
this is a note from GNU ld manual:
- - - -
3.4.1 Setting the Entry Point
The first instruction to execute in a program is called the entry point. You can use the
ENTRY linker script command to set the entry point. The argument is a symbol name:
ENTRY(symbol)
There are several ways to set the entry point. The linker will set the entry point by trying
each of the following methods in order, and stopping when one of them succeeds:
• the ‘-e’ entry command-line option;
• the ENTRY(symbol) command in a linker script;
• the value of the symbol start, if defined;
• the address of the first byte of the ‘.text’ section, if present;
• The address 0.
- - - -
>
> Thank you in advance
>
> Damiens
> _______________________________________________
> users mailing list
> users@xxxxxxxxx
> http://lists.rtems.org/mailman/listinfo/users
...
duhuanpeng.
_______________________________________________
users mailing list
users@xxxxxxxxx
http://lists.rtems.org/mailman/listinfo/users