1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/tools/llvm-objcopy
Jake Ehrlich f69705a3db [llvm-objcopy] Fix handling of zero-size segments in llvm-objcopy
Some ELF files produced by lld may have zero-size segment placeholders as shown
below. Since GNU_STACK Offset is 0, the current code makes it the lowest used
offset, and relocates all the segments over the ELF header. The resulting
binary is total garbage.

This change fixes how llvm-objcopy handles PT_PHDR properlly by treating ELF
headers and the program header table as segments to allow the layout algorithm
decide where those should go.

Author: vit9696

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

llvm-svn: 325189
2018-02-14 23:31:33 +00:00
..
Inputs [llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects 2018-01-25 22:46:17 +00:00
abs-symbol.test
add-gnu-debuglink.test [llvm-objcopy] Add --add-gnu-debuglink 2018-01-25 22:15:14 +00:00
add-section-remove.test [llvm-objcopy] Add option to add a progbits section from a file 2017-12-19 00:47:30 +00:00
add-section.test [llvm-objcopy] Add option to add a progbits section from a file 2017-12-19 00:47:30 +00:00
adjacent-segments.test
basic-binary-copy.test
basic-copy.test
basic-keep.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
basic-only-keep.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
basic-relocations.test
binary-first-seg-offset-zero.test [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy 2017-11-15 19:13:31 +00:00
binary-no-paddr.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00
binary-out-error.test [llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects 2018-01-25 22:46:17 +00:00
binary-paddr.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00
binary-remove-all-but-one.test [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy 2017-11-15 19:13:31 +00:00
binary-remove-end.test [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy 2017-11-15 19:13:31 +00:00
binary-remove-middle.test [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy 2017-11-15 19:13:31 +00:00
binary-segment-layout.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00
cannot-delete-dest.test Simplify test. 2017-12-05 18:26:23 +00:00
check-addr-offset-align-binary.test [llvm-objcopy] Fix bug in how segment alignment was being handled 2017-11-02 23:24:04 +00:00
check-addr-offset-align.test [llvm-objcopy] Fix bug in how segment alignment was being handled 2017-11-02 23:24:04 +00:00
common-symbol.test
drawf-fission.test [llvm-objcopy] Add support for dwarf fission 2017-11-03 18:58:41 +00:00
dump-section.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
dynamic-relocations.test
dynamic.test
dynstr.test
dynsym-error-remove-strtab.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
dynsym.test
elf32be.test [llvm-objcopy] Support the rest of the ELF formats 2017-11-14 18:41:47 +00:00
elf32le.test [llvm-objcopy] Support the rest of the ELF formats 2017-11-14 18:41:47 +00:00
elf64be.test [llvm-objcopy] Support the rest of the ELF formats 2017-11-14 18:41:47 +00:00
empty-section.test
explicit-keep-remove.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
explicit-only-keep-remove.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
fail-no-output-directory.test Make sure an error is always handled. 2017-11-08 21:15:21 +00:00
hexagon-unsupported-on-x86.test
identical-segments.test
keep-many.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
keep-only-keep.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
localize-hidden.test [llvm-objcopy] Add --localize-hidden option 2018-01-05 19:19:09 +00:00
marker-segment.test [llvm-objcopy] Fix handling of zero-size segments in llvm-objcopy 2018-02-14 23:31:33 +00:00
no-symbol-relocation.test
only-keep-many.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
only-keep-remove-strtab.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
only-keep-strip-non-alloc.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
overlap-chain.test
parent-loop-check.test [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy 2017-11-15 19:13:31 +00:00
program-headers.test
pt-phdr.test
reloc-error-remove-symtab.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
remove-multiple-sections.test [llvm-objcopy] Add ability to remove multiple sections by name 2017-10-10 23:02:43 +00:00
remove-section-with-symbol.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
remove-section.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
remove-shstrtab-error.test [llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects 2018-01-25 22:46:17 +00:00
remove-symtab.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
section-index-unsupported.test
sectionless-segment.test
segment-shift-section-remove.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
segment-shift.test
segment-test-remove-section.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
strip-all-gnu.test [llvm-objcopy] Add --strip-all-gnu and change --strip-all 2017-11-27 18:56:01 +00:00
strip-all.test [llvm-objcopy] Add --strip-all-gnu and change --strip-all 2017-11-27 18:56:01 +00:00
strip-debug.test [llvm-objcopy] Add --strip-debug 2017-11-13 22:13:08 +00:00
strip-dwo-inplace.test [llvm-objcopy] Make modifications in-place if output is not specified 2018-02-09 23:33:31 +00:00
strip-non-alloc.test [llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sections 2017-11-14 18:50:24 +00:00
strip-sections-keep.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
strip-sections-only-keep.test [llvm-objcopy] Add support for --only-keep/-j and --keep 2017-11-30 20:14:53 +00:00
strip-sections.test Reland "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data" 2017-10-11 18:09:18 +00:00
symbol-copy.test [llvm-objcopy] Add support for visibility 2018-01-02 23:01:24 +00:00
symtab-error-on-remove-strtab.test [llvm-objcopy] Add support for removing sections 2017-10-10 18:47:09 +00:00
triple-overlap.test
two-seg-remove-end.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00
two-seg-remove-first.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00
two-seg-remove-third-sec.test [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary 2018-01-22 19:27:30 +00:00