parent
84b5ac8640
commit
4eeae59293
@ -331,7 +331,13 @@ def configure(env):
|
|||||||
env.Append(LIBS=['execinfo'])
|
env.Append(LIBS=['execinfo'])
|
||||||
|
|
||||||
if not env['tools']:
|
if not env['tools']:
|
||||||
env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld'])
|
import subprocess
|
||||||
|
import re
|
||||||
|
binutils_version = re.search('\s(\d+\.\d+)', str(subprocess.check_output(['ld', '-v']))).group(1)
|
||||||
|
if float(binutils_version) >= 2.30:
|
||||||
|
env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld'])
|
||||||
|
else:
|
||||||
|
env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.legacy.ld'])
|
||||||
|
|
||||||
## Cross-compilation
|
## Cross-compilation
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
/* Add a zero-sized section; the exporter will patch it to enclose the data appended to the executable (embedded PCK) */
|
/* Add a zero-sized section; the exporter will patch it to enclose the data appended to the executable (embedded PCK) */
|
||||||
pck 0 (NOLOAD) :
|
pck 0 (INFO) :
|
||||||
{
|
{
|
||||||
/* Just some content to avoid the linker discarding the section */
|
/* binutils >= 2.30 allow it being zero-sized, but needs something between the braces to keep the section */
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
platform/x11/pck_embed.legacy.ld
Normal file
10
platform/x11/pck_embed.legacy.ld
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The exporter will patch this section to enclose the data appended to the executable (embedded PCK) */
|
||||||
|
pck 0 (INFO) : AT ( ADDR (.rodata) + SIZEOF (.rodata) )
|
||||||
|
{
|
||||||
|
/* binutils < 2.30 need some actual content for the linker not to discard the section */
|
||||||
|
BYTE(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
INSERT AFTER .rodata;
|
Loading…
Reference in New Issue
Block a user