]> git.proxmox.com Git - mirror_edk2.git/commit - MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S
MdePkg/BaseMemoryLibOptDxe ARM: add missing function annotations
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 12 Dec 2018 10:04:44 +0000 (11:04 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 13 Dec 2018 11:45:49 +0000 (12:45 +0100)
commitdecaac5d0d4a5ae348035a33e820ffd902103383
tree6397ef4eaffeb84e2fc69a4fc749f22d804b9002
parent580f4539dfbbd1dfbf8f613be4e3c278bed1434d
MdePkg/BaseMemoryLibOptDxe ARM: add missing function annotations

ARM uses the low order bit of a branch target address to decide in
which execution mode (ARM or Thumb) a function needs to be called.
In order for this to work across object files, ELF function symbols
will have the low bit set if they were emitted in Thumb mode and
cleared otherwise. This annotation is only emitted if the ELF symbols
are annotated as function, since taking the address of some data
symbol (e.g., a literal) should not produce a value with the low bit
set, even if it appears in an object file containing Thumb code.

This means that all functions coded in assembler must have this
function annotation, or they may end up getting called in the
wrong mode, crashing the program.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S
MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S