ARM: Tell the linker memset and memcpy are functions.
The memset and memcpy functions are assembled as ARM code, likely because that's the default of the assembler. Without special annotation, the assembler and linker don't know that those symbols are functions which need special handling so that ARM/thumb issues are handled properly. This change adds that annotation which gets those functions working in Coreboot which is compiled as thumb. Libpayload and depthcharge are compiled as ARM so they don't *need* the annotation since it just works out in ARM mode, but it's the safe thing to do in case we change that in the future. We should explicitly select ARM vs. thumb when assembling assembly files to be consistent across builds and toolchains. BUG=None TEST=Built with the assembly versions of memcpy and memset turned on and saw that we could boot after this change where we couldn't before. Disassembled a function which calls memset and saw that it was using the blx instruction which can change mode instead of the bl instruction which can't. BRANCH=None Change-Id: Ic3ef4faf17d3467b5042c944106b8743d517cce3 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/58728 Commit-Queue: Gabe Black <gabeblack@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com>
This commit is contained in:
parent
5811d973b1
commit
e838749425
4 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,7 @@
|
|||
|
||||
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
|
||||
|
||||
.type memcpy, function
|
||||
.globl memcpy
|
||||
memcpy:
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
* memset again.
|
||||
*/
|
||||
|
||||
.type memset, function
|
||||
.globl memset
|
||||
memset:
|
||||
ands r3, r0, #3 @ 1 unaligned?
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
|
||||
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
|
||||
|
||||
.type memcpy, function
|
||||
.globl memcpy
|
||||
memcpy:
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
* memset again.
|
||||
*/
|
||||
|
||||
.type memset, function
|
||||
.globl memset
|
||||
memset:
|
||||
ands r3, r0, #3 @ 1 unaligned?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue