[all-commits] [llvm/llvm-project] d48d33: [lld][ELF] Add --shuffle-sections=seed to shuffle ...

Rafael Ávila de Espíndola via All-commits all-commits at lists.llvm.org
Wed Feb 19 13:44:23 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d48d339156916b4dd87a8c06c1c242fd794f08e5
      https://github.com/llvm/llvm-project/commit/d48d339156916b4dd87a8c06c1c242fd794f08e5
  Author: Rafael Ávila de Espíndola <rafael at espindo.la>
  Date:   2020-02-19 (Wed, 19 Feb 2020)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/Options.td
    M lld/ELF/Writer.cpp
    M lld/docs/ld.lld.1
    A lld/test/ELF/shuffle-sections.s

  Log Message:
  -----------
  [lld][ELF] Add --shuffle-sections=seed to shuffle input sections

Summary:
This option causes lld to shuffle sections by assigning different
priorities in each run.

The use case for this is to introduce randomization in benchmarks. The
idea is inspired by the paper "Producing Wrong Data Without Doing
Anything Obviously Wrong!"
(https://www.inf.usi.ch/faculty/hauswirth/publications/asplos09.pdf). Unlike
the paper, we shuffle individual sections, not just input files.

Doing this in lld is particularly convenient as the --reproduce option
makes it easy to collect all the necessary bits for relinking the
program being benchmarked. Once that it is done, all that is needed is
to add --shuffle-sections=0 to the response file and relink before each
run of the benchmark.

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




More information about the All-commits mailing list