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.

453 questions
3
votes
2 answers

LINKER script GCC how to avoid veneer call

I work on the project where I copy some functions to the RAM from FLASH and call them. Everything is OK except one small problem I have - if I call function directly the compiler adds the veneer call instead (which calls the funtion in the RAM…
0___________
  • 60,014
  • 4
  • 34
  • 74
3
votes
2 answers

How can i get LD to put always put the entry point at the location of -Ttext?

I'm writing my own operating system (static addresses) and I struggle to get the linker to always put my _start function at my desired location within the processes. I specify the location with -Ttext 0x10000 in my build file (Lets just say 0x10000…
Espen Nilsen
  • 121
  • 1
  • 7
3
votes
0 answers

GNU AS value not in assigned section

I am currently trying to build a two-stage bootloader in GNU assembler. I use the as command to compile the assembly files and the ld command to link them to the final binary. Some information beforehand: $ as --version GNU assembler (GNU Binutils…
CRoemheld
  • 889
  • 7
  • 26
3
votes
1 answer

Difference between input and output sections in a linkerfile?

While it could be clear in the context of a resulting binary or ELF file what is a section, many places in documentation (independently of the compiler used) refers them as to Input or Output sections. What are the differences between these?
urnenfeld
  • 1,030
  • 9
  • 25
3
votes
1 answer

Difference between map file and linker file

What is the difference between the map file generated by the linker and the linker file that contains the memory segments itself ?
3
votes
1 answer

bss section end address is less than start address

I am looking at ARC processor map file and found a section which end address is less than start address. Is this normal or a bug in the linker script or other issues? Section name type start addr end addr length RM0_SECTION …
electro
  • 911
  • 4
  • 12
  • 28
3
votes
1 answer

AURIX TriCore Linker Script Command "REGION_MAP"

I am adapting some linker scripts from the rather new AURIX TriCore MCUs. There is a command I do not understand at all and the documentation [0] is not really helpful. Can somebody tell me in principle, what is going on there? What is meant with…
j35t3r
  • 1,254
  • 2
  • 19
  • 53
3
votes
1 answer

Referring to a specific symbol in a static library with the GNU gold linker

When laying out symbols in the address space using a linker script, ld allows to refer to a specific symbol coming from a static library with the following syntax: archive.a:object_file.o(.section.symbol_name) Using gold rather than ld, it seems…
3
votes
0 answers

Import of linker symbols for inline assembler in Rust

I want to access a linker symbol defined in the linker file in inline assembler in Rust for an ARM target. However, asm!(".import mysymb"); leads to error: :1:2: error: unknown directive .import mysymb Using .extern (as suggested here)…
Matthias
  • 8,018
  • 2
  • 27
  • 53
3
votes
0 answers

Link two object files via linker script

I have two source files (one is written in NASM assembly - try.asm, another in plain C - tryasmc.c). I have a C function func() in the .c file which I have to link to the extern func in the assembly file. The try.asm file : section .text extern…
ayandas
  • 2,070
  • 1
  • 13
  • 26
3
votes
1 answer

How does the .bss section copied to RAM?

I am new to embedded systems low-level programming and I am quite confused what happens exactly after the linker generate an output object file and during flashing the .bin file. 1- I see in the linker script that the loadable memory address(LMA)…
Keith Ape
  • 1,103
  • 1
  • 12
  • 28
3
votes
1 answer

C++ shared library symbols versioning

I'm trying to create library with two versions of the same function using __asm__(".symver ...... approach library.h #ifndef CTEST_H #define CTEST_H int first(int x); int second(int x); #endif library.cpp #include "simple.h" #include…
Vaska el gato
  • 198
  • 15
3
votes
0 answers

Checking output file size in linker script

I am experimenting with GNU LD linker scripts and I have defined two memory blocks, using the MEMORY command, like this: MEMORY { code [(rx)] : ORIGIN = 0x00010000, LENGTH = 0x00020000 /* 128 kB */ heap [(rwx)] : ORIGIN = 0x40000000, LENGTH…
Nikopol
  • 1,091
  • 1
  • 13
  • 24
3
votes
1 answer

arm-none-eabi-gcc: SECTIONS: unclear syntax *.a:

I could not find a clear answer to a very specific problem, even after reading several manual pages and guides. I work on a linker script for the tool chain mentioned in the title. During the development I was tying to link a static library…
Afoxinabox
  • 319
  • 2
  • 9
3
votes
1 answer

Linker script: align section to the next power of two

So, I have this linker script: MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 } SECTIONS { .kernel.text : { _kernel_text = .; …
Cheiron
  • 3,620
  • 4
  • 32
  • 63