[PATCH] D21598: Fix a bug that MIPS thunks can overwrite other section contents.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 22:33:10 PDT 2016


ruiu created this revision.
ruiu added reviewers: rafael, peter.smith.
ruiu added a subscriber: llvm-commits.
Herald added subscribers: sdardis, aemerson.

Peter Smith found while trying to support thunk creation for ARM that
LLD sometimes creates broken thunks for MIPS. The cause of the bug is
that we assign file offsets to input sections too early. We need to
create all sections and then assign section offsets because appending
thunks changes file offsets for all following sections.

This patch separates the pass to assign file offsets from thunk
creation pass. This effectively reverts r265673.

http://reviews.llvm.org/D21598

Files:
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Writer.cpp
  test/ELF/mips-npic-call-pic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21598.61505.patch
Type: text/x-patch
Size: 20013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160622/5aeb879e/attachment.bin>


More information about the llvm-commits mailing list