Skip to content

Commit

Permalink
Moved build-id sections to the main .text/.data sections to prevent l…
Browse files Browse the repository at this point in the history
…d link warning.
  • Loading branch information
nieklinnenbank committed Oct 20, 2015
1 parent 11d2584 commit e4ab510
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 68 deletions.
6 changes: 1 addition & 5 deletions config/arm/raspberry/kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ OUTPUT_FORMAT("elf32-littlearm")

SECTIONS
{
/DISCARD/ :
{
*(.note.gnu.build-id)
}

/* Starts at LOADER_ADDR. */
. = 0x8000;
__start = .;
Expand All @@ -50,6 +45,7 @@ SECTIONS
.data :
{
*(.data)
*(.note.gnu.build-id)

CTOR_LIST = .;
KEEP (*(SORT(.ctors.*)))
Expand Down
6 changes: 1 addition & 5 deletions config/arm/raspberry/user.ld
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ SECTIONS
{
. = 0x80000000;

/DISCARD/ :
{
*(.note.gnu.build-id)
}

.text :
{
*(.entry)
Expand All @@ -38,6 +33,7 @@ SECTIONS
*(.rodata)
*(.rodata.*)
*(.eh_frame)
*(.note.gnu.build-id)

. = ALIGN(4);
CTOR_LIST = .;
Expand Down
60 changes: 28 additions & 32 deletions config/intel/pc/kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,65 +27,61 @@ SECTIONS
. = 0x00100000;
kernelStart = .;

/DISCARD/ :
{
*(.note.gnu.build-id)
}

.text virt : AT(phys)
{
code = .;
*(.boot)
*(.text)
*(*.text)
*(.gnu.linkonce.*)
*(.rodata)
*(.rodata.*)
*(.eh_frame)
. = ALIGN(4096);
code = .;
*(.boot)
*(.text)
*(*.text)
*(.gnu.linkonce.*)
*(.rodata)
*(.rodata.*)
*(.eh_frame)
. = ALIGN(4096);
}

.data : AT (phys + (data - code))
{
data = .;
*(.data)
data = .;
*(.data)
*(.note.gnu.build-id)

CTOR_LIST = .;
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*(.preinit_array))
KEEP (*(.init_array.*))
KEEP (*(.init_array))
LONG(0)
LONG(0)
CTOR_END = .;

DTOR_LIST = .;
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(.fini_array.*))
KEEP (*(.fini_array))
LONG(0)
DTOR_END = .;
. += 4;
. += 4;

initStart = .;
KEEP (*(SORT(.init*)))
initEnd = .;
initStart = .;
KEEP (*(SORT(.init*)))
initEnd = .;
isKernel = .;
LONG(1);
. = ALIGN(4096);
. = ALIGN(4096);
}

.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
*(.bss.*)
*(COMMON)
bss = .;
*(.bss)
*(.bss.*)
*(COMMON)

. += 4;
kernelEnd = .;
kernelEnd = .;

. = 0x00400000;
. = 0x00400000;
}
}
48 changes: 22 additions & 26 deletions config/intel/pc/user.ld
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,42 @@ SECTIONS
{
. = 0x80000000;

/DISCARD/ :
{
*(.note.gnu.build-id)
}

.text :
{
*(.entry)
*(.text)
*(*.text)
*(.gnu.linkonce.*)
*(.data)
*(.rodata)
*(.rodata.*)
*(.eh_frame)
*(.entry)
*(.text)
*(*.text)
*(.gnu.linkonce.*)
*(.data)
*(.rodata)
*(.rodata.*)
*(.eh_frame)
*(.note.gnu.build-id)

. = ALIGN(4);
. = ALIGN(4);
CTOR_LIST = .;
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*(.preinit_array))
KEEP (*(.init_array.*))
KEEP (*(.init_array))
LONG(0)
LONG(0)
CTOR_END = .;

DTOR_LIST = .;
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(.dtors))
KEEP (*(.fini_array.*))
KEEP (*(.fini_array))
LONG(0)
DTOR_END = .;
. += 4;
initStart = .;
KEEP (*(SORT(.init*)))
KEEP (*(.init*))
initEnd = .;
. += 4;
initStart = .;
KEEP (*(SORT(.init*)))
KEEP (*(.init*))
initEnd = .;
isKernel = .;
LONG(0);

Expand Down

0 comments on commit e4ab510

Please sign in to comment.