[all-commits] [llvm/llvm-project] 9ad017: [ELF] Keep non-alloc orphan sections at the end

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jun 6 12:13:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ad0175ea0099351050e1dfb0074d9938f469404
      https://github.com/llvm/llvm-project/commit/9ad0175ea0099351050e1dfb0074d9938f469404
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-06-06 (Thu, 06 Jun 2024)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/linkerscript/memory-nonalloc-no-warn.test
    M lld/test/ELF/linkerscript/sections-nonalloc.s
    M lld/test/ELF/linkerscript/sections.s

  Log Message:
  -----------
  [ELF] Keep non-alloc orphan sections at the end

https://reviews.llvm.org/D85867 changed the way we assign file offsets
(alloc sections first, then non-alloc sections).

It also removed a non-alloc special case from `findOrphanPos`.
Looking at the memory-nonalloc-no-warn.test change, which would be
needed by #93761, it makes sense to restore the previous behavior: when
placing non-alloc orphan sections, keep these sections at the end so
that the section index order matches the file offset order.

This change is cosmetic. In sections-nonalloc.s, GNU ld places the
orphan `other3` in the middle and the orphan .symtab/.shstrtab/.strtab
at the end.

Pull Request: https://github.com/llvm/llvm-project/pull/94519



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list