Questions tagged [linker-scripts]

The linker command language used to control the memory layout of computer programs and details of the linking process.

Linker scripts contain a command language processed by the linker to determine how sections in input files are mapped into the output file. Most often used to control the memory layout in computer programs, they can also exercise fine control over details of the linking process.

360 questions
0
votes
1 answer

How to use this linker script program?

If I write a code in my program.c as a global declaration : #pragma DATA_SECTION (measurements, ".myvarloc"); uint8 measurements[30]; i write the below code and save it as a.ld: MEMORY { MYMEMORY(rw) : ORIGIN = 0x0041c620 , LENGTH =…
0
votes
1 answer

how to get 18 bit code address from symbol defined in linker command file

In Code Composer, you can define new symbols in the linker command file simply: _Addr_start = 0x5C00; _AppLength = 0x4C000; before the memory map and section assignment. This is done in the bootloader example from TI. You can then refer to the…
Mark Lakata
  • 18,024
  • 5
  • 88
  • 112
0
votes
1 answer

ARM GNU GCC linker

This is related to GNU linker.If I have a section which is other than .text , .data or .bss how do I tell linker not to include that section in any of those segments. Ex: SECTIONS { .text {} .data {} .bss {} .sec_var {} } Actually in my case…
user2807984
  • 23
  • 2
  • 7
0
votes
1 answer

Adding section to GNU linker script

Hi I am trying to define a custom section in my linker script in a following way: .version_section(__custom_data__) : { KEEP (*version_info.o (.rodata* .data* .sdata*)) } I am compiling a C file that contains a structure and I want…
Steve H
  • 431
  • 1
  • 7
  • 18
0
votes
1 answer

Memory sections in GNU linker script for Cortex-M4

I'm dissapointed, because I can't find an information about memory segmentation. I know that I should divide memory into basic sections such as .text, .data, .bss, .stack, that are used in object files of compiled program. I know that there are many…
bkdi
  • 33
  • 6
0
votes
2 answers

Meaning of arm loader script

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_ram_entry) SECTIONS { . = 0xA0008000; . = ALIGN(4); .text : { *(.text) } . = ALIGN(4); .rodata : { *(.rodata) } . = ALIGN(4); …
Young Hyun Yoo
  • 590
  • 8
  • 21
0
votes
1 answer

Unexpected linker section output location

I'm trying to use the ld command in linux on an assembly file for a kernel. For it to boot with grub, it needs to be after the 1Mb address. So my link script has the text going to the address 0x00100000. Here's the linker script I'm using: …
skagzilla
  • 225
  • 2
  • 10
0
votes
0 answers

ORG assembly directive and location counter in linker script

As far as I understand using the ORG directive in assembly (NASM assembly in particular) and setting the location counter in a linker script to some value perform the same function. However I am wondering that if I use both the org directive and the…
vjain27
  • 3,124
  • 8
  • 37
  • 56
-1
votes
2 answers

Erasing and writing into flash gives an error while building

I am writing a program in C for NXP freescale kinetis microcontroller KEA128. I modified the linker description file and proceeded to write a simple C program in C. But when I build the project, it gives the following error message…
user8540390
  • 143
  • 1
  • 8
-1
votes
1 answer

Adding a condition to Linker Command File

Can i write a condition in the .lcf ? I want to check if the sum of certain sections is above a certain threshold. if yes i want the linker to show Error/Warning I'm new to the .lcf and i don't know if this is possible or not. Any Advice ? Linker…
-1
votes
1 answer

Linker cannot find existing Static Library File

I have a Eclipse project using C programming language. I have been stuck with a problem related to linker error since two days now. I have checked various forums to find a solution. Tried a lot of the suggestions but could not resolve it. So as a…
Abinash
  • 21
  • 2
-1
votes
1 answer

How to implement OVERLAY in i386 linker via linker scripts

I am trying to link the Overlay example from the GDB reference manual. The example is targeting the d10v processor (not familiar with it) but I would like to demonstrate that the debugger works with overlays by compiling the example for the x86_64…
muman
  • 124
  • 6
-2
votes
1 answer

can i allocate a variable to a certain address during run time using linker script?

I'm new to using the linker script and there is a concept I'm not sure that i really understand. I know that i can use the linker script to allocate sections in the memory at certain addresses, but that's during compilation time, so can that address…
Mostafa
  • 1
  • 3
-3
votes
2 answers

Array partially empty

I have written a startup and liker script for my C++ application, running on STM32F407VG. The problem is i have an array of structure, where the structure field str is always zero despite the initialization. The other field in the struct are…
mauro
  • 59
  • 5
-4
votes
2 answers

Is it possible to allocate same address to two different global variables in C?

Is it possible to allocate same address to two different global variables in C in same build? I have tried several ways using linker but I was not successful. If it is not allowed, can someone please elaborate why? And if it is allowed, how to do…
1 2 3
23
24