[all-commits] [llvm/llvm-project] f969c2: [LLD][ELF][ARM] Fix ARM Exidx order for non monoto...

Peter Smith via All-commits all-commits at lists.llvm.org
Thu Apr 23 07:52:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f969c2aa657e28633ece63a5430e551f0b8beb98
      https://github.com/llvm/llvm-project/commit/f969c2aa657e28633ece63a5430e551f0b8beb98
  Author: Peter Smith <peter.smith at arm.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/Writer.cpp
    A lld/test/ELF/arm-exidx-script-order.s

  Log Message:
  -----------
  [LLD][ELF][ARM] Fix ARM Exidx order for non monotonic section order

The contents of the .ARM.exidx section must be ordered by SHF_LINK_ORDER
rules. We don't need to know the precise address for this order, but we
do need to know the relative order of sections. We have been using the
sectionIndex for this purpose, this works when the OutputSection order
has a monotonically increasing virtual address, but it is possible to
write a linker script with non-monotonically increasing virtual address.
For these cases we need to evaluate the base address of the OutputSection
so that we can order the .ARM.exidx sections properly.

This change moves the finalisation of .ARM.exidx till after the first
call to AssignAddresses. This permits us to sort on virtual address which
is linker script safe. It also permits a fix for part of pr44824 where
we generate .ARM.exidx section for the vector table when that table is so
far away it is out of range of the .ARM.exidx section. This fix will come
in a follow up patch.

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




More information about the All-commits mailing list