aboutsummaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2015-10-26 17:36:48 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2015-11-03 12:00:22 +1100
commit12cbf22606c1148c64389449fb607a804cfade27 (patch)
tree58a28335dad9821b20f69cff0b4bb7b64f4fdca2 /clients
parent67422f93710a872329aef197ec932f67a616c888 (diff)
downloadSLOF-12cbf22606c1148c64389449fb607a804cfade27.zip
SLOF-12cbf22606c1148c64389449fb607a804cfade27.tar.gz
SLOF-12cbf22606c1148c64389449fb607a804cfade27.tar.bz2
qemu/js2x/client: Support binutils >= 2.25.1
The recent binutils version introduces explicit definition of a TOC symbol which points to the .toc section and enforces .toc alignment to 256 rather than 8 bytes before. For now the TOC symbol points to same location as it was before - start of .toc + 0x8000; however as this might change, we should not rely on that in the source code. This changes __toc_start (for qemu and js2x boards), _got (for net-snk, takeover, rtas) in linker scripts to use explicitely defined TOC if defined and fall back to the older scheme if not. This changes r2 (the register pointing to TOC) setup code not to add 0x8000 as linker scripts do that now. Here is a bit more information about the change: https://sourceware.org/ml/binutils/2015-10/msg00124.html https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=a27e685fa0a6480bdb07e3be359558524cec89b7 Tested on 1. gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC) GNU ld version 2.23.2 2. gcc version 5.2.1 20151001 (GCC) GNU ld (GNU Binutils) 2.25.51.20150930 Reported-by: William Grant <wgrant@ubuntu.com> Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'clients')
-rw-r--r--clients/net-snk/client.lds4
-rw-r--r--clients/net-snk/kernel/entry.S2
-rw-r--r--clients/takeover/client.lds4
-rw-r--r--clients/takeover/entry.S2
4 files changed, 6 insertions, 6 deletions
diff --git a/clients/net-snk/client.lds b/clients/net-snk/client.lds
index 39d0459..c208644 100644
--- a/clients/net-snk/client.lds
+++ b/clients/net-snk/client.lds
@@ -44,10 +44,10 @@ SECTIONS {
*(.opd)
}
- . = ALIGN(0x10);
+ . = ALIGN(256);
.got :
{
- _got = .;
+ _got = DEFINED (.TOC.) ? .TOC. : ADDR (.got) + 0x8000;
*(.got)
*(.toc)
_got_end = .;
diff --git a/clients/net-snk/kernel/entry.S b/clients/net-snk/kernel/entry.S
index 8849fb9..bf10542 100644
--- a/clients/net-snk/kernel/entry.S
+++ b/clients/net-snk/kernel/entry.S
@@ -44,7 +44,7 @@ C_ENTRY(_entry)
bcl 20,31,over # branch after pointer table
base:
.align 3
-.LCgot: .quad _got-base+0x8000
+.LCgot: .quad _got-base
.LCstack: .quad _stack+STACKSIZE-0x80-base
over:
mflr r8 # gpr 8 is the base
diff --git a/clients/takeover/client.lds b/clients/takeover/client.lds
index 2701d8e..0ab428a 100644
--- a/clients/takeover/client.lds
+++ b/clients/takeover/client.lds
@@ -43,8 +43,8 @@ SECTIONS {
.got :
{
- . = ALIGN(8);
- _got = .;
+ . = ALIGN(256);
+ _got = DEFINED (.TOC.) ? .TOC. : ADDR (.got) + 0x8000;
*(.got .toc)
_got_end = .;
}
diff --git a/clients/takeover/entry.S b/clients/takeover/entry.S
index a1030eb..ff48273 100644
--- a/clients/takeover/entry.S
+++ b/clients/takeover/entry.S
@@ -21,7 +21,7 @@ _wrapclient:
bcl 20,31,over # branch after pointer table
base:
.align 3
-.LCgot: .quad _got-base+0x8000
+.LCgot: .quad _got-base
over:
mflr r8 # gpr 8 is the base
ld r2, .LCgot-base(r8) # load got pointer