[all-commits] [llvm/llvm-project] 80e9dd: [llvm-readobj] - Change how we create DynRegionInf...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Aug 21 01:36:21 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 80e9dd08784fc4f28bb04a8e9c0639d433a94d08
      https://github.com/llvm/llvm-project/commit/80e9dd08784fc4f28bb04a8e9c0639d433a94d08
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-08-21 (Fri, 21 Aug 2020)

  Changed paths:
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readobj] - Change how we create DynRegionInfo objects. NFCI.

Currently we have `checkDRI` and two `createDRIFrom` methods which
are used to create `DynRegionInfo` objects.

And we have an issue: constructions like:
`ObjF->getELFFile()->base() + P->p_offset`
that are used in `createDRIFrom` functions might overflow.

I had to revert `D85519` which triggered such UBSan failure.

This NFC, simplifies and generalizes how we create `DynRegionInfo` objects.
It will allow us to introduce more/better validation checks in a single place.
It also will allow to change `createDRI` to return `Expected<>` so
that we will be able to stop using the `reportError`, which
is used inside currently, and have a warning instead.

Differential revision: https://reviews.llvm.org/D86297




More information about the All-commits mailing list