sunxi-tools/boot_head.lds
Siarhei Siamashka 776cf5543b Fix compatibility with Linaro toolchains for building ARM binaries
Add DISCARD directives to the linker scripts and also -marm option
to GCC command line. Without this, certain toolchains may build
Thumb2 code by default. Also junk sections may be present in the
final binary and they need to be removed.

This helps at least when using the following Linaro toolchain:
gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf.tar.xz

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Reviewed-by: Bernhard Nortmann <bernhard.nortmann@web.de>
2016-05-06 13:33:15 +02:00

29 lines
945 B
Plaintext

/*
* Copyright (C) 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
SECTIONS
{
. = 0x40007000;
.text : { *(.text) }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
/DISCARD/ : { *(.interp*) }
/DISCARD/ : { *(.gnu*) }
/DISCARD/ : { *(.note*) }
}