Like Tree1Likes
  • 1 Post By brewbuck

Linker scripts

This is a discussion on Linker scripts within the Tech Board forums, part of the Community Boards category; What are Linker Scripts? How to write them?...

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    1

    Linker scripts

    What are Linker Scripts? How to write them?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,540
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    The manual doesn't give a good idea of WHY you would use a linker script.

    A linker script lets you do three main things:

    1. You can define new symbols at link time. These are simple variables that take on numeric values that can only be calculated at link time. For instance, if you wanted a variable which contained the size of the .text section, you could do this via linker script directives.
    2. You can control the mapping from input sections to output sections. For instance, you can cause all of the .text from a specific object to go into a special section separate from the rest of the code. Or you could tell the linker to place all sections into one big section with no distinction between them.
    3. You can control the exact layout of the sections, both in terms of their position in the output file as well as their position in virtual memory once they have been loaded.

    All of these are very special-purpose tasks.
    Salem likes this.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need Help with scripts for a game!
    By LubuKage in forum Game Programming
    Replies: 5
    Last Post: 07-12-2010, 07:27 PM
  2. about cgi scripts
    By xixpsychoxix in forum Networking/Device Communication
    Replies: 11
    Last Post: 07-08-2008, 06:03 PM
  3. C++ for CGI scripts
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-03-2003, 09:53 AM
  4. Linux scripts
    By billholm in forum Linux Programming
    Replies: 7
    Last Post: 07-07-2002, 11:37 PM
  5. CGI scripts in c/c++ ?
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-14-2001, 01:24 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21