SuccessChanges

Summary

  1. [ELF][test] Improve --wrap tests (details)
  2. [ELF] --wrap: Produce a dynamic symbol for undefined __wrap_ (details)
Commit 8031785f4a7ebd027edb34c91cbcf48db53ef444 by i
[ELF][test] Improve --wrap tests
The file was modifiedlld/test/ELF/wrap-shlib-undefined.s
Commit f96ff3c0f8ebd941b3f6b345164c3d858b781484 by i
[ELF] --wrap: Produce a dynamic symbol for undefined __wrap_

```
// a.s
jmp fcntl
// b.s
.globl fcntl
fcntl:
  ret
```

`ld.lld -shared --wrap=fcntl a.o b.o` has an `R_X86_64_JUMP_SLOT` referencing
the index 0 undefined symbol, which will cause a glibc `symbol lookup error` at
runtime. This is because `__wrap_fcntl` is not in .dynsym

We use an approximation `!wrap->isUndefined()`, which doesn't set
`isUsedInRegularObj` of `__wrap_fcntl` when `fcntl` is referenced and
`__wrap_fcntl` is undefined.

Fix this by using `sym->referenced`.
The file was modifiedlld/ELF/Driver.cpp
The file was modifiedlld/ELF/Symbols.h
The file was modifiedlld/test/ELF/wrap-shlib-undefined.s