SuccessChanges

Summary

  1. AMDGPU/GlobalISel: Remove illegal select tests (details)
  2. [ELF] Map the ELF header at imageBase (details)
  3. [ELF][X86] Allow PT_LOAD to have overlapping p_offset ranges on (details)
Commit 255d157672262c5a4d5a4241d99610b02edaa459 by Matthew.Arsenault
AMDGPU/GlobalISel: Remove illegal select tests
These fail in a release build.
llvm-svn: 371955
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-constant.mir
Commit 06bb7dfbd445fe928b0ae0263ba9df1acd861c41 by maskray
[ELF] Map the ELF header at imageBase
If there is no readonly section, we map:
* The ELF header at imageBase+maxPageSize
* Program headers at imageBase+maxPageSize+sizeof(Ehdr)
* The first section .text at
imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers)
Due to the interaction between Writer<ELFT>::fixSectionAlignments and
LinkerScript::allocateHeaders,
`alignDown(p_vaddr(R PT_LOAD)) = alignDown(p_vaddr(RX PT_LOAD))`. The RX
PT_LOAD will override the R PT_LOAD at runtime, which is not ideal:
```
// PHDR at 0x401034, should be 0x400034
PHDR           0x000034 0x00401034 0x00401034 0x000a0 0x000a0 R   0x4
// R PT_LOAD contains just Ehdr and program headers.
// At 0x401000, should be 0x400000
LOAD           0x000000 0x00401000 0x00401000 0x000d4 0x000d4 R 
0x1000
LOAD           0x0000d4 0x004010d4 0x004010d4 0x00001 0x00001 R E
0x1000
```
* createPhdrs allocates the headers to the R PT_LOAD.
* fixSectionAlignments assigns
`imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers)` (formula:
`alignTo(dot, maxPageSize) + dot % config->maxPageSize`) to addrExpr of
.text
* allocateHeaders computes the minimum address among SHF_ALLOC sections,
i.e. addr(.text)
* allocateHeaders sets address of ELF header to
`addr(.text)-sizeof(Ehdr)-sizeof(program headers) =
imageBase+maxPageSize`
The main observation is that when the SECTIONS command is not used, we
don't have to call allocateHeaders. This requires an assumption that the
presence of PT_PHDR and addresses of headers can be decided regardless
of address information.
This may seem natural because dot is not manipulated by a linker script.
The other thing is that we have to drop the special rule for -T<section>
in `getInitialDot`. If -Ttext is smaller than the image base, the
headers will not be allocated with the old behavior (allocateHeaders is
called) but always allocated with the new behavior.
The behavior change is not a problem. Whether and where headers are
allocated can vary among linkers, or ld.bfd across different versions
(--enable-separate-code or not). It is thus advised to use a linker
script with the PHDRS command to have a consistent behavior across
linkers. If PT_PHDR is needed, an explicit --image-base can be a simpler
alternative.
Differential Revision: https://reviews.llvm.org/D67325
llvm-svn: 371957
The file was modifiedlld/test/ELF/basic-ppc.s
The file was modifiedlld/test/ELF/basic-i386.s
The file was modifiedlld/test/ELF/basic-aarch64.s
The file was modifiedlld/test/ELF/ttext-tdata-tbss.s
The file was modifiedlld/ELF/Writer.cpp
The file was modifiedlld/ELF/LinkerScript.cpp
The file was modifiedlld/test/ELF/basic-sparcv9.s
Commit d4306e90cb18f663342068a4ad83ba42545dbf01 by maskray
[ELF][X86] Allow PT_LOAD to have overlapping p_offset ranges on
EM_X86_64
Port the D64906 technique to EM_X86_64.
Differential Revision: https://reviews.llvm.org/D67482
llvm-svn: 371958
The file was modifiedlld/test/ELF/rel-offset.s
The file was modifiedlld/test/ELF/x86-64-reloc-gotpc64.s
The file was modifiedlld/test/ELF/x86-64-tls-dynamic.s
The file was modifiedlld/test/ELF/x86-64-retpoline-znow-static-iplt.s
The file was modifiedlld/test/ELF/x86-64-tlsdesc-ld.s
The file was modifiedlld/test/ELF/emit-relocs.s
The file was modifiedlld/test/ELF/gnu-ifunc-noplt.s
The file was modifiedlld/test/ELF/eh-frame-hdr-icf-fde.s
The file was modifiedlld/test/ELF/Inputs/copy-rel-abs.s
The file was modifiedlld/test/ELF/got.s
The file was modifiedlld/test/ELF/cgprofile-txt.s
The file was modifiedlld/test/ELF/x86-64-gotpc-relax.s
The file was modifiedlld/test/ELF/defsym-reserved-syms.s
The file was modifiedlld/test/ELF/basic.s
The file was modifiedlld/test/ELF/common-page.s
The file was modifiedlld/test/ELF/no-inhibit-exec.s
The file was modifiedlld/test/ELF/copy-rel-large.s
The file was modifiedlld/test/ELF/gdb-index-ranges-discarded.s
The file was modifiedlld/test/ELF/cgprofile-obj.s
The file was modifiedlld/test/ELF/relocation.s
The file was modifiedlld/test/ELF/x86-64-retpoline-znow.s
The file was modifiedlld/test/ELF/linkerscript/page-size.s
The file was modifiedlld/test/ELF/x86-64-reloc-gotoff64.s
The file was modifiedlld/test/ELF/eh-frame-merge.s
The file was modifiedlld/test/ELF/eh-frame-hdr-augmentation.s
The file was modifiedlld/test/ELF/ztext.s
The file was modifiedlld/test/ELF/gnu-ifunc-plt.s
The file was modifiedlld/test/ELF/gdb-index-dwarf5-low-high.s
The file was modifiedlld/test/ELF/startstop.s
The file was modifiedlld/test/ELF/x86-64-plt.s
The file was modifiedlld/test/ELF/partition-notes.s
The file was modifiedlld/test/ELF/x86-64-gotpc-relax-und-dso.s
The file was modifiedlld/test/ELF/cgprofile-bad-clusters.s
The file was modifiedlld/test/ELF/linkerscript/symbol-reserved.s
The file was modifiedlld/test/ELF/linkerscript/absolute.s
The file was modifiedlld/test/ELF/eh-frame-hdr.s
The file was modifiedlld/test/ELF/relro-tls.s
The file was modifiedlld/test/ELF/relocation-copy.s
The file was modifiedlld/test/ELF/partition-pack-dyn-relocs.s
The file was modifiedlld/test/ELF/x86-64-tls-ie-local.s
The file was modifiedlld/test/ELF/x86-64-reloc-error2.s
The file was modifiedlld/test/ELF/Inputs/copy-rel-tls.s
The file was modifiedlld/test/ELF/symbols.s
The file was modifiedlld/test/ELF/gnu-ifunc.s
The file was modifiedlld/test/ELF/just-symbols.s
The file was modifiedlld/test/ELF/partition-synthetic-sections.s
The file was modifiedlld/test/ELF/x86-64-tls-ie.s
The file was modifiedlld/test/ELF/eh-frame-pcrel-overflow.s
The file was modifiedlld/test/ELF/undef-with-plt-addr.s
The file was modifiedlld/test/ELF/tls-offset.s
The file was modifiedlld/test/ELF/x86-64-reloc-range.s
The file was modifiedlld/test/ELF/end-dso-defined.s
The file was modifiedlld/test/ELF/end-update.s
The file was modifiedlld/test/ELF/end.s
The file was modifiedlld/test/ELF/local-got-pie.s
The file was modifiedlld/test/ELF/edata-etext.s
The file was modifiedlld/test/ELF/eh-frame-value-format8.s
The file was modifiedlld/test/ELF/fill-trap.s
The file was modifiedlld/test/ELF/verdef-defaultver.s
The file was modifiedlld/test/ELF/gdb-index.s
The file was modifiedlld/test/ELF/relocation-copy-relro.s
The file was modifiedlld/test/ELF/common.s
The file was modifiedlld/test/ELF/image-base.s
The file was modifiedlld/test/ELF/ttext-tdata-tbss.s
The file was modifiedlld/test/ELF/relocation-common.s
The file was modifiedlld/test/ELF/gdb-index-gc-sections.s
The file was modifiedlld/test/ELF/x86-64-got-plt-header.s
The file was modifiedlld/test/ELF/global_offset_table_shared.s
The file was modifiedlld/test/ELF/linkerscript/synthetic-symbols3.test
The file was modifiedlld/test/ELF/eh-align-cie.s
The file was modifiedlld/test/ELF/build-id.s
The file was modifiedlld/test/ELF/cgprofile-icf.s
The file was modifiedlld/test/ELF/apply-dynamic-relocs.s
The file was modifiedlld/test/ELF/gnu-ifunc-canon.s
The file was modifiedlld/test/ELF/local-got.s
The file was modifiedlld/test/ELF/cgprofile-txt2.s
The file was modifiedlld/test/ELF/abs-hidden.s
The file was modifiedlld/test/ELF/x86-64-retpoline.s
The file was modifiedlld/test/ELF/pre_init_fini_array_missing.s
The file was modifiedlld/test/ELF/eh-frame-hdr-abs-fde.s
The file was modifiedlld/test/ELF/x86-64-reloc-size.s
The file was modifiedlld/test/ELF/edata-no-bss.s
The file was modifiedlld/test/ELF/gnu-ifunc-dyntags.s
The file was modifiedlld/ELF/Writer.cpp
The file was modifiedlld/test/ELF/tls.s
The file was modifiedlld/test/ELF/symbol-ordering-file-cgprofile-conflicts.s
The file was modifiedlld/test/ELF/x86-64-tls-opt-noplt.s
The file was modifiedlld/test/ELF/x86-64-relax-got-abs.s
The file was modifiedlld/test/ELF/startstop-shared2.s
The file was modifiedlld/test/ELF/gnu-ifunc-shared.s
The file was modifiedlld/test/ELF/segments.s
The file was modifiedlld/test/ELF/symbol-ordering-file-icf.s
The file was modifiedlld/test/ELF/ehframe-relocation.s
The file was modifiedlld/test/ELF/cgprofile-reproduce.s
The file was modifiedlld/test/ELF/relative-dynamic-reloc-pie.s
The file was modifiedlld/test/ELF/gdb-index-rng-lists.s
The file was modifiedlld/test/ELF/relocation-copy-align-common.s
The file was modifiedlld/test/ELF/x86-64-tlsdesc-gd.s
The file was modifiedlld/test/ELF/copy-rel-tls.s
The file was modifiedlld/test/ELF/relocatable.s
The file was modifiedlld/test/ELF/relocation-undefined-weak.s
The file was modifiedlld/test/ELF/x86-64-tls-gdie.s
The file was modifiedlld/test/ELF/gdb-index-ranges.s
The file was modifiedlld/test/ELF/eh-frame-value-format7.s
The file was modifiedlld/test/ELF/map-file.s
The file was modifiedlld/test/ELF/x86-64-plt-high-addr.s
The file was modifiedlld/test/ELF/x86-64-tls-gd-local.s
The file was modifiedlld/test/ELF/combreloc.s
The file was modifiedlld/test/ELF/comdat.s
The file was modifiedlld/test/ELF/relocation-non-alloc.s
The file was modifiedlld/test/ELF/relro-bss.s
The file was modifiedlld/test/ELF/x86-64-gotpc-relax-nopic.s
The file was modifiedlld/test/ELF/emit-relocs-icf1.s
The file was modifiedlld/test/ELF/gdb-index-base-addr.s
The file was modifiedlld/test/ELF/entry.s
The file was modifiedlld/test/ELF/avoid-empty-program-headers.s
The file was modifiedlld/test/ELF/emit-relocs-mergeable.s
The file was modifiedlld/test/ELF/local-got-shared.s
The file was modifiedlld/test/ELF/relocation-copy-flags.s