Add unit tests for ELF filter-library symbol handling.
* ObjectFileELFTest.FilterLibraryPlaceholderSymbols: a yaml2obj ELF
filter library with two DT_AUXILIARY entries checks that
GetReExportedLibraries() returns the filtees in dynamic-section
order, that zero-sized exported functions become re-exported symbols
recording the first filtee and the unversioned name (@VERSION suffix
stripped), and that nonzero-sized and local definitions are left
alone.
* ReExportedSymbolTest.ResolveThroughFilteesInOrder: a target holding
a filter library and two filtee modules checks that
Symbol::ResolveReExportedSymbol finds a definition in the first
filtee via the library recorded on the symbol, continues to the next
filtee in declaration order for symbols the first filtee lacks, and
that without the containing module only the recorded library is
searched.
Co-Authored-By: Claude Fable 5 <noreply at anthropic.com>
[clang][bytecode] Fix comparing `TemplateParamObjectDecl`s (#208734)
1) When creating the global variables for them, always use the first
decl
2) When converting null pointers to `APValue`, don't cast the nullptr
base to `Expr` or `ValueDecl`. Use `LValueBase()` instead, so the
internal `PointerUnion` has an all-zeros value as `getOpaqueValue()`. If
we don't do this, we run into problems with merging of
`TemplateParamObjectDecls` because they don't compare equal via
`::Profile()`.
www/gitlab: fix regression from d747b3e47669abac14d4808212f48455fbe3f3fe
www/rubygem-js-routes 2.4.x includes in incompatible API change which
breaks gitlab at runtime while e.g. loading projects.
The problem only appears if the asset for gitlab are recompiled with
this new version which makes it harder to spot the problem.
I will follow up the issue here:
https://gitlab.com/gitlab-org/gitlab/-/work_items/605464
Thanks a lot to Peter for finding the cause of that problem!
PR: 296698
Add unit tests for ELF filter-library symbol handling.
* ObjectFileELFTest.FilterLibraryPlaceholderSymbols: a yaml2obj ELF
filter library with two DT_AUXILIARY entries checks that
GetReExportedLibraries() returns the filtees in dynamic-section
order, that zero-sized exported functions become re-exported symbols
recording the first filtee and the unversioned name (@VERSION suffix
stripped), and that nonzero-sized and local definitions are left
alone.
* ReExportedSymbolTest.ResolveThroughFilteesInOrder: a target holding
a filter library and two filtee modules checks that
Symbol::ResolveReExportedSymbol finds a definition in the first
filtee via the library recorded on the symbol, continues to the next
filtee in declaration order for symbols the first filtee lacks, and
that without the containing module only the recorded library is
searched.
Co-Authored-By: Claude Fable 5 <noreply at anthropic.com>
[LLDB] Support Auxiliary library in ELF format
An ELF filter library (DT_FILTER) or auxiliary filter (DT_AUXILIARY)
delegates symbol resolution to its filtee: the dynamic linker looks up
each symbol in the filtee first, falling back to the filter library's
own definition. Filter library may export placeholder smyolbs whose
addresses are not the actual function entry points.
To support this, we teach ObjectFileELF to parse the filtee and model
placeholder function definition in filter libraries as ReExported,
reusing the existing re-export machinery.
Notice that in ELF, we don't record the per-symbol target ReExported
library like Macho. Instead, it is a suggestion list from the libraries
that exposes this symbol. As a result, we need to pass the library
Module to read the suggestion list to correctly parse the file in
Resolver.
[SROA] Use constant 64-bit indices for Extract/InsertElement (#208918)
The canonical form preferred by instCombine is to use 64-bit values for
constant index in ExtractElement and InsertElement.
[LoadStoreVectorizer] Use constant 64-bit indices for Extract/InsertElement (#208941)
The canonical form preferred by instCombine is to use 64-bit values for
constant index in ExtractElement and InsertElement.
[ELF,test] Improve .relr.auth.dyn -> .rela.dyn movement coverage (#208991)
Test two behaviors of #195649 that were unasserted:
- .dynamic shrinks when all .relr.auth.dyn entries are moved to a
non-empty .rela.dyn. Check the section header size: readelf -d stops
at the first DT_NULL and cannot show stale padding. This subsumes
empty-relr.s (a size-neutral tag swap, which passed even without the
fix), so remove it.
- An empty .rela.dyn is removed when .relr.auth.dyn is unused. Assert
this in pack-dyn-relocs-relr-loop.s.
[SLP] Use constant 64-bit indices for Extract/InsertElement (#208957)
The canonical form preferred by instCombine is to use 64-bit values for
constant index in ExtractElement and InsertElement.
[lld][ELF] Allow explicit address expressions on .tbss output sections (#196447)
D107208 allows consecutive SHF_TLS SHT_NOBITS (.tbss) output sections by
making
each .tbss start at the end address of the previous one
(state->tbssAddr). This
happens unconditionally, so an explicit output section address
(`.tbss ADDR : { ... }`) is silently ignored, unlike GNU ld.
Apply the tbssAddr fallback only when the section has no address
expression.
Some embedded/RTOS applications link the kernel and several mutually
isolated
tasks into a single ELF and require every section, .tbss included, to
sit at a
specific address matching the memory map. Placing a task's .tbss in its
own
protected region is a security boundary: one task must not be able to
[3 lines not shown]
[clang][bytecode] Remove EvalEmitter::OpPC (#208988)
We pass this when evaluting opcodes in EvalEmitter, but we never set it
to anything, so the underlying pointer is always null and we later and
up using the source location of the expression we're evaluating.
This seems to only cause problems when Statement expressions are
involved so far.