summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2017-03-01 04:44:04 +0000
committerSean Silva <chisophugis@gmail.com>2017-03-01 04:44:04 +0000
commitd4e606273b16e21c3b1f3617bdb33569ca6ff22c (patch)
tree3d1014eaa306ba654f056c765d8d436bddfea8d0
parent6f9b60cf38047bc3c2753e5d4b1c13179547d8a2 (diff)
downloadbcm5719-llvm-d4e606273b16e21c3b1f3617bdb33569ca6ff22c.tar.gz
bcm5719-llvm-d4e606273b16e21c3b1f3617bdb33569ca6ff22c.zip
Improve comment.
Thanks to Rafael for helping to dig down into what we're really trying to communicate here. llvm-svn: 296580
-rw-r--r--lld/ELF/Symbols.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 59e43d3854a..37435841c3b 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -74,12 +74,14 @@ static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) {
// An object in an SHF_MERGE section might be referenced via a
// section symbol (as a hack for reducing the number of local
// symbols).
- // We must incorporate the addend into the section offset (and
- // zero out the addend for later processing) so that we find the
- // right object in the section.
- // Note that for an ordinary symbol we do not perform this
- // adjustment and thus effectively assume that the addend cannot
- // cross the boundaries of mergeable objects.
+ // Depending on the addend, the reference via a section symbol
+ // refers to a different object in the merge section.
+ // Since the objects in the merge section are not necessarily
+ // contiguous in the output, the addend can thus affect the final
+ // VA in a non-linear way.
+ // To make this work, we incorporate the addend into the section
+ // offset (and zero out the addend for later processing) so that
+ // we find the right object in the section.
if (D.isSection()) {
Offset += Addend;
Addend = 0;
OpenPOWER on IntegriCloud