mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
v850: improve linker scripts for relocatable linking
Quite a few constructs where unconditional when they should take $RELOCATING into account. The original observation was that output of "ld -r" had .text start at 0x00100000.
This commit is contained in:
@@ -26,7 +26,7 @@ SECTIONS
|
|||||||
/* This saves a little space in the ELF file, since the zda starts
|
/* This saves a little space in the ELF file, since the zda starts
|
||||||
at a higher location that the ELF headers take up. */
|
at a higher location that the ELF headers take up. */
|
||||||
|
|
||||||
.zdata ${ZDATA_START_ADDR} :
|
.zdata ${RELOCATING+${ZDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.zdata)
|
*(.zdata)
|
||||||
${RELOCATING+*(.zbss)
|
${RELOCATING+*(.zbss)
|
||||||
@@ -40,7 +40,7 @@ SECTIONS
|
|||||||
section. Specifically it prevents the zdata
|
section. Specifically it prevents the zdata
|
||||||
section from being marked READONLY. */
|
section from being marked READONLY. */
|
||||||
|
|
||||||
.rozdata ${ROZDATA_START_ADDR} :
|
.rozdata ${RELOCATING+${ROZDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.rozdata)
|
*(.rozdata)
|
||||||
${RELOCATING+*(romzdata)
|
${RELOCATING+*(romzdata)
|
||||||
@@ -48,7 +48,7 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read-only sections, merged into text segment. */
|
/* Read-only sections, merged into text segment. */
|
||||||
. = ${TEXT_START_ADDR};
|
${RELOCATING+. = ${TEXT_START_ADDR};}
|
||||||
.interp : { *(.interp) }
|
.interp : { *(.interp) }
|
||||||
.hash : { *(.hash) }
|
.hash : { *(.hash) }
|
||||||
.dynsym : { *(.dynsym) }
|
.dynsym : { *(.dynsym) }
|
||||||
@@ -95,7 +95,7 @@ SECTIONS
|
|||||||
It contains a small lookup table at the start followed by the
|
It contains a small lookup table at the start followed by the
|
||||||
code pointed to by entries in the lookup table. */
|
code pointed to by entries in the lookup table. */
|
||||||
|
|
||||||
.call_table_data ${CALL_TABLE_START_ADDR} :
|
.call_table_data ${RELOCATING+${CALL_TABLE_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE(__ctbp = .);}
|
${RELOCATING+PROVIDE(__ctbp = .);}
|
||||||
*(.call_table_data)
|
*(.call_table_data)
|
||||||
@@ -144,7 +144,7 @@ SECTIONS
|
|||||||
.got : {${RELOCATING+ *(.got.plt)} *(.got) }
|
.got : {${RELOCATING+ *(.got.plt)} *(.got) }
|
||||||
.dynamic : { *(.dynamic) }
|
.dynamic : { *(.dynamic) }
|
||||||
|
|
||||||
.tdata ${TDATA_START_ADDR} :
|
.tdata ${RELOCATING+${TDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE (__ep = .);
|
${RELOCATING+PROVIDE (__ep = .);
|
||||||
*(.tbyte)
|
*(.tbyte)
|
||||||
@@ -158,14 +158,14 @@ SECTIONS
|
|||||||
can access them all, and initialized data all before uninitialized, so
|
can access them all, and initialized data all before uninitialized, so
|
||||||
we can shorten the on-disk segment size. */
|
we can shorten the on-disk segment size. */
|
||||||
|
|
||||||
.sdata ${SDATA_START_ADDR} :
|
.sdata ${RELOCATING+${SDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
|
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
|
||||||
*(.sdata)
|
*(.sdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See comment about .rozdata. */
|
/* See comment about .rozdata. */
|
||||||
.rosdata ${ROSDATA_START_ADDR} :
|
.rosdata ${RELOCATING+${ROSDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.rosdata)
|
*(.rosdata)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ SECTIONS
|
|||||||
/* This saves a little space in the ELF file, since the zda starts
|
/* This saves a little space in the ELF file, since the zda starts
|
||||||
at a higher location that the ELF headers take up. */
|
at a higher location that the ELF headers take up. */
|
||||||
|
|
||||||
.zdata ${ZDATA_START_ADDR} :
|
.zdata ${RELOCATING+${ZDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.zdata)
|
*(.zdata)
|
||||||
${RELOCATING+*(.zdata23)
|
${RELOCATING+*(.zdata23)
|
||||||
@@ -42,7 +42,7 @@ SECTIONS
|
|||||||
section. Specifically it prevents the zdata
|
section. Specifically it prevents the zdata
|
||||||
section from being marked READONLY. */
|
section from being marked READONLY. */
|
||||||
|
|
||||||
.rozdata ${ROZDATA_START_ADDR} :
|
.rozdata ${RELOCATING+${ROZDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.rozdata)
|
*(.rozdata)
|
||||||
${RELOCATING+*(romzdata)
|
${RELOCATING+*(romzdata)
|
||||||
@@ -52,7 +52,7 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read-only sections, merged into text segment. */
|
/* Read-only sections, merged into text segment. */
|
||||||
. = ${TEXT_START_ADDR};
|
${RELOCATING+. = ${TEXT_START_ADDR};}
|
||||||
.interp : { *(.interp) }
|
.interp : { *(.interp) }
|
||||||
.hash : { *(.hash) }
|
.hash : { *(.hash) }
|
||||||
.dynsym : { *(.dynsym) }
|
.dynsym : { *(.dynsym) }
|
||||||
@@ -99,7 +99,7 @@ SECTIONS
|
|||||||
It contains a small lookup table at the start followed by the
|
It contains a small lookup table at the start followed by the
|
||||||
code pointed to by entries in the lookup table. */
|
code pointed to by entries in the lookup table. */
|
||||||
|
|
||||||
.call_table_data ${CALL_TABLE_START_ADDR} :
|
.call_table_data ${RELOCATING+${CALL_TABLE_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE(__ctbp = .);}
|
${RELOCATING+PROVIDE(__ctbp = .);}
|
||||||
*(.call_table_data)
|
*(.call_table_data)
|
||||||
@@ -154,7 +154,7 @@ SECTIONS
|
|||||||
.got : {${RELOCATING+ *(.got.plt)} *(.got) }
|
.got : {${RELOCATING+ *(.got.plt)} *(.got) }
|
||||||
.dynamic : { *(.dynamic) }
|
.dynamic : { *(.dynamic) }
|
||||||
|
|
||||||
.tdata ${TDATA_START_ADDR} :
|
.tdata ${RELOCATING+${TDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE (__ep = .);
|
${RELOCATING+PROVIDE (__ep = .);
|
||||||
*(.edata)
|
*(.edata)
|
||||||
@@ -174,7 +174,7 @@ SECTIONS
|
|||||||
can access them all, and initialized data all before uninitialized, so
|
can access them all, and initialized data all before uninitialized, so
|
||||||
we can shorten the on-disk segment size. */
|
we can shorten the on-disk segment size. */
|
||||||
|
|
||||||
.sdata ${SDATA_START_ADDR} :
|
.sdata ${RELOCATING+${SDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
|
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
|
||||||
*(.sdata)
|
*(.sdata)
|
||||||
@@ -182,7 +182,7 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* See comment about .rozdata. */
|
/* See comment about .rozdata. */
|
||||||
.rosdata ${ROSDATA_START_ADDR} :
|
.rosdata ${RELOCATING+${ROSDATA_START_ADDR}} :
|
||||||
{
|
{
|
||||||
*(.rosdata)
|
*(.rosdata)
|
||||||
${RELOCATING+*(.sconst)
|
${RELOCATING+*(.sconst)
|
||||||
|
|||||||
Reference in New Issue
Block a user