HomeFreeBSD

lld: Fix weak symbols on arm and aarch64

Description

lld: Fix weak symbols on arm and aarch64

Given

.weak target
.global _start
_start:
b target

The intention is that the branch goes to the instruction after the
branch, effectively turning it on a nop. The branch adds the runtime
PC, but we were adding it statically too.

I noticed the oddity by inspection, but llvm-objdump seems to agree,
since it now prints things like:

b #-4 <_start+0x4>

Obtained from: LLD commit r305212
Differential Revision: https://reviews.freebsd.org/D11191

Reviewed by: dim, Rafael EspĂ­ndola
Obtained from: LLD r305212
MFC after: 3 days

Details

Provenance
emasteAuthored on
Reviewer
dim
Differential Revision
D11191: Merge LLD r305212: Fix weak symbols on arm and aarch64
Parents
rS319955: lld: sort relocations
Branches
Unknown
Tags
Unknown