Commit Graph

6 Commits

Author SHA1 Message Date
Fangrui Song 7c74ce3c68 [ELF] --wrap: don't clear sym->isUsedInRegularObj if real->isUsedInRegularObj; set wrap's initial binding to sym's
Fix PR49897: if `__real_foo` has the isUsedInRegularObj bit set, we need to
retain `foo` in .symtab, even if `foo` is undefined. The new behavior will match
GNU ld.

Before the patch, we produced an R_X86_64_JUMP_SLOT relocation referencing the
index 0 undefined symbol, which would be erroed by glibc
(see f96ff3c0f8).

While here, fix another bug: if `__wrap_foo` does not exist, its initial binding
should be `foo`'s.
2021-04-17 00:29:51 -07:00
Fangrui Song e281376e99 [ELF] --wrap: set isUsedInRegularObj of __wrap_ only if it is defined
Fixes PR46169
2020-08-01 18:19:14 -07:00
Fangrui Song a6ae333a0c [ELF] --wrap: don't error `undefined reference to __real_foo` (--no-allow-shlib-undefined) if foo is a wrapped definition
This is a regression after D51283.

Also, export `foo` if `__real_foo` is referenced by a shared object.
2020-06-01 23:00:51 -07:00
Fangrui Song 4672e52e22 [llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf
While updating the test, change -l -S to -S -l as the output of -S goes
before -l.

llvm-svn: 359653
2019-05-01 06:02:16 +00:00
Fangrui Song b159906a9a [test] Change llvm-readobj -long-option to --long-option or well-known short options. NFC
Also change some options that have different semantics (cause confusion) in llvm-readelf mode:

-s => -S
-t => --symbols
-sd => --section-data

llvm-svn: 359651
2019-05-01 05:49:01 +00:00
Rafael Espindola cf00d4374e Fix PR33635.
This is a semantic revert of r306036.

We have to change the names, otherwise dynamic relocations will point
to the wrong name.

llvm-svn: 307110
2017-07-05 00:43:18 +00:00