[all-commits] [llvm/llvm-project] 8a5a12: [BOLT][Wrapper] Fix off-by-one in find_section upp...

Job Noorman via All-commits all-commits at lists.llvm.org
Tue May 16 00:26:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb
      https://github.com/llvm/llvm-project/commit/8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb
  Author: Job Noorman <jnoorman at igalia.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M bolt/utils/llvm-bolt-wrapper.py

  Log Message:
  -----------
  [BOLT][Wrapper] Fix off-by-one in find_section upper limit

find_section used to match offsets equal to file_offset + size causing
offsets to sometimes be attributed to the wrong section.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D149047


  Commit: 6c06a079365db7bdf579b52a5ea1b6ba4a947611
      https://github.com/llvm/llvm-project/commit/6c06a079365db7bdf579b52a5ea1b6ba4a947611
  Author: Job Noorman <jnoorman at igalia.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h

  Log Message:
  -----------
  [JITLink] Process null symbols

Some relocations (e.g., R_RISCV_ALIGN) don't have a target symbol and
use a null symbol as a placeholder. These symbols were not processed
before making it impossible to create edges for them.

This patch tries to detect these null symbols and create absolute
symbols for them. Note that technically, these null symbols are UND in
the ELF file, not ABS, so it might make more consistent to create a new
symbol type for this (local undefined or so). However, since these
symbols are only used as placeholders (i.e., their values are never
used), I don't think it's worth the effort of doing this.

Also note that in the binaries that I have inspected, this null symbol
always has index 0. Could it make sense to add that to the test to avoid
accidentally adding unnecessary symbols? The reason I didn't do this
yet, is that I couldn't find any references in the specs that actually
guarantee this.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D149541


Compare: https://github.com/llvm/llvm-project/compare/4054c68644df...6c06a079365d


More information about the All-commits mailing list