diff options
author | Fangrui Song <maskray@google.com> | 2019-08-28 09:01:03 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-08-28 09:01:03 +0000 |
commit | 8fbe81fb29e5c7f7d5e68e82063d43410121e6c4 (patch) | |
tree | ac1f6fe251217d5819ce4c93e83d1a136b7ab26b /lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py | |
parent | a761ba0f2d4bb4e977a3cef52d569e34e721f8bc (diff) | |
download | bcm5719-llvm-8fbe81fb29e5c7f7d5e68e82063d43410121e6c4.tar.gz bcm5719-llvm-8fbe81fb29e5c7f7d5e68e82063d43410121e6c4.zip |
[ELF][RISCV] Assign st_shndx of __global_pointer$ to 1 if .sdata does not exist
This essentially reverts the code change of D63132 and switches to a simpler approach.
In an executable/shared object, st_shndx of a symbol can be:
1) SHN_UNDEF: undefined symbol (or canonical PLT)
2) SHN_ABS: absolute symbol
3) any other value (usually a regular section index) represents a relative symbol.
The actual value does not matter.
Many ld.so (musl, all archs except MIPS of FreeBSD rtld-elf) even treat 2) and 3)
the same. If .sdata does not exist, it does not matter what value/section
__global_pointer$ has, as long as it is relative (otherwise there will be a pedantic
lld error. See D63132). Just set the st_shndx arbitrarily to 1.
Dummy st_shndx=1 may be used by __rela_iplt_start, linker-script-defined symbols outside a section, __dso_handle, etc.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D66798
llvm-svn: 370172
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py')
0 files changed, 0 insertions, 0 deletions