link.ld help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
thoover

link.ld help

Post by thoover »

ok, here is my link.ld

Code: Select all

OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
  .text phys : AT(phys) {
    code = .;
    *(.text)
    . = ALIGN(4096);
  }
  .data : AT(phys + (data - code))
  {
    data = .;
    *(.data)
    . = ALIGN(4096);
  }
  .bss : AT(phys + (bss - code))
  {
    bss = .;
    *(.bss)
    . = ALIGN(4096);
  }
  end = .;
}
it makes a 4K, 4096byte binary file
can any one tell me how to get it to go to only the size i need even if it changes with out changing the file every change.

thanks
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:link.ld help

Post by Candy »

it makes a 4K, 4096byte binary file
can any one tell me how to get it to go to only the size i need even if it changes with out changing the file every change.

thanks
Stop aligning on 4k boundaries.
Post Reply