net-snk: Sanitize our .lds file

No need to have a single giant section, break it back up, add
some missing bits, and make sure .opd is separate so that objdump
and gdb can properly reconstitute the dot symbols.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ do not discard .comment, this is fixed with binutils 2.24]
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
This commit is contained in:
Benjamin Herrenschmidt 2014-07-15 20:52:32 +10:00 committed by Nikunj A Dadhania
parent 1e732c553f
commit c3c8d6ae27
3 changed files with 56 additions and 31 deletions

View File

@ -15,37 +15,71 @@ OUTPUT_ARCH(powerpc:common64)
ENTRY(_entry)
SECTIONS {
.client 0xF000100:
{
__client_start = .;
*(.text .stub .text.* .gnu.linkonce.t.*)
. = 0xF000100;
.text :
{
__client_start = .;
*(.text* .stub .gnu.linkonce.t.*)
*(.sfpr .glink)
*(.rodata .rodata.* .gnu.linkonce.r.*)
KEEP (*(.opd))
. = ALIGN(256);
*(.data .data.* .gnu.linkonce.d.*)
. = ALIGN(256);
} =0x60000000
.lowmem :
{
_lowmem_start = .;
*(.lowmem)
_lowmem_end = .;
}
. = ALIGN(0x100);
.rodata :
{
*(.rodata* .gnu.linkonce.r.*)
}
. = ALIGN(0x10);
.data :
{
*(.data* .gnu.linkonce.d.*)
*(.force.data)
*(.toc1)
*(.branch_lt)
}
. = ALIGN(0x10);
.opd :
{
*(.opd)
}
. = ALIGN(0x10);
.got :
{
. = ALIGN(8);
_got = .;
*(.got .toc)
*(.got)
*(.toc)
_got_end = .;
}
.comment : { *(.comment) }
.branch_lt : { *(.branch_lt) }
}
. = ALIGN(0x1000);
.bss :
{
*(*COM* .bss .gnu.linkonce.b.*)
*(*COM* .bss* .gnu.linkonce.b.*)
}
__client_end = .;
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
. = ALIGN(0x10);
.dynamic : {
*(.dynamic)
}
. = ALIGN(0x10);
.rela.dyn : {
*(.rela*)
}
.hash : { *(.hash) }
.comment : {
/*
* Discarding this section caused errors on binutils 2.23,
* this is fixed in 2.24.
*/
*(.comment)
}
/DISCARD/ : {
*(.interp)
}
}

View File

@ -31,8 +31,6 @@ snk_fileio_t fd_array[FILEIO_MAX];
extern uint64_t tb_freq;
extern char _lowmem_start;
extern char _lowmem_end;
extern char __client_start;
extern char __client_end;

View File

@ -28,13 +28,6 @@ SECTIONS {
/* *(*COM* .bss .gnu.linkonce.b.*) */
} =0x60000000
.lowmem :
{
_lowmem_start = .;
*(.lowmem)
_lowmem_end = .;
}
.got :
{
. = ALIGN(8);