[PATCH] D59269: ELF: Use bump pointer allocator for uncompressed section buffers. NFCI.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 02:21:27 PDT 2019


grimar added inline comments.


================
Comment at: ELF/InputSection.h:217
+  // Since the feature is not used often, this is usually -1.
+  mutable int64_t UncompressedSize = -1;
 };
----------------
ruiu wrote:
> grimar wrote:
> > Not relative to this patch, but I wonder why this is an `int64_t` and not a `uint64_t`.
> To represent -1 as -1, I guess?
But it could be `uint64_t`, we already have code around in linker that does that.
E.g:

```
  // Get an offset in an output section this relocation is applied to.
  uint64_t Offset = GetOffset.get(Rel.r_offset);
  if (Offset == uint64_t(-1))
    return;
```

I am not sure it is useful atm to have a max size of `UncompressedSize` to be `max(uint64)-1`
instead of `max(int64_t)`, but why not...


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59269/new/

https://reviews.llvm.org/D59269





More information about the llvm-commits mailing list