llvm-project/lld/test/pecoff
Rui Ueyama 495a031ce4 [PECOFF] Fix AMD64_REL_[1-5] and AMD64_SECTION relocations
I hope this is the last fix for x64 relocations as I've wasted
a few days on this.

This caused a mysterious issue that some C++ programs crash on
startup. It was because a null pointer is passed as argv to main.
__tmainCRTStartup calls main, but before that it calls all
initialization routines between .text$xc_a and .text$xc_z.
pre_cpp_init is one of such routines, and it is the one who
initializes a heap pointer for argv for later use. That routine
was not called for some reason.

It turned out that __tmainCRTStartup was skipping a block of
code because of the relocation bug. A condition in the function
depends on a memory load, and that memory load was referring
a wrong location. As a result a jump instruction took the
wrong branch, skipping pre_cpp_init and so on.

This patch fixes the issue. Also added more tests to fix them
once and for all.

llvm-svn: 216772
2014-08-29 20:33:27 +00:00
..
Inputs [PECOFF] Fix AMD64_REL_[1-5] and AMD64_SECTION relocations 2014-08-29 20:33:27 +00:00
alignment.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
alternatename.test [PECOFF] Fix entry point functions selection 2014-07-23 00:57:57 +00:00
associative.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
base-reloc.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
baseaddr.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
bss-section.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
comdat.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
common-symbol.test [PECOFF] Fix common symbol alignment. 2014-04-09 01:01:51 +00:00
dll.test [PECOFF] Set DLL bit in PE header if DLL. 2014-07-17 00:22:26 +00:00
dosstub.test [PECOFF] Infer subsystem from the entry point function. 2013-11-25 02:00:00 +00:00
drectve.test [PECOFF] Fix /include option in .drectve section. 2014-08-04 23:48:57 +00:00
dynamic.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
dynamicbase.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
entry.test [PECOFF] Fix entry point address. 2014-07-23 20:51:04 +00:00
export-warning.test Add a blank line to FileCheck input. 2014-01-09 02:47:52 +00:00
export.test [PECOFF] Find symbols with @number suffix for dllexported symbols 2014-05-14 06:29:32 +00:00
exportlib.test [PECOFF] Add a test for r197803. 2014-01-09 01:11:48 +00:00
exportlib2.test [PECOFF] Resolve dllexported symbols. 2014-05-09 22:19:49 +00:00
grouped-sections.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
hello.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
hello64.test [PECOFF] Fix PE+ relocations 2014-08-22 01:15:43 +00:00
help.test [PECOFF] Fix /? option and add a test for the flag. 2013-09-24 17:59:30 +00:00
imagebase.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
importlib.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
include.test [ELF] Support --defsym option to define an absolute symbol. 2014-03-28 19:02:06 +00:00
lib.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
libarg.test [PECOFF] Fix arguments passed to lib.exe. 2014-03-14 05:04:08 +00:00
localyimported.test [PECOFF] Fix _imp_ implicit symbols. 2014-04-29 00:32:00 +00:00
long-section-name.test [PECOFF] Truncate long section name. 2013-12-17 06:15:09 +00:00
machinetype.test [PECOFF] Handle objects with unknown machine type header value. 2014-03-13 05:12:36 +00:00
manifest.test [PECOFF] Add one more test for r206633. 2014-04-18 20:44:05 +00:00
merge-largest.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
merge-same-size.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
multi.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00
noentry.test [PECOFF] Add a test for /noentry. 2013-12-27 08:19:21 +00:00
nonstandard-sections.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
options.test [PECOFF] Add /HighEntropyVA. 2014-08-25 22:23:34 +00:00
pe32plus.test [PECOFF] Add /HighEntropyVA. 2014-08-25 22:23:34 +00:00
reloc.test [PECOFF] Fix _imp_ implicit symbols. 2014-04-29 00:32:00 +00:00
reloc64.test [PECOFF] Fix AMD64_REL_[1-5] and AMD64_SECTION relocations 2014-08-29 20:33:27 +00:00
resource.test [PECOFF] Fix failing test. 2014-07-28 22:31:37 +00:00
responsefile.test [PECOFF] Print out command line if we have expanded response files. 2014-03-25 20:40:27 +00:00
safeseh.test [PECOFF] Add a test for /SAFESEH:NO for non-x86 machine type. 2014-02-27 00:05:43 +00:00
section-attribute.test [PECOFF] Set section characteristics based /section options. 2013-11-27 23:44:58 +00:00
section-renaming.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
seh.test [PECOFF] Discard .debug sections. 2014-05-21 05:56:31 +00:00
seh64.test [PECOFF] Another Win64 relocation bug fix 2014-08-28 19:00:40 +00:00
subsystem.test [PECOFF] Infer subsystem from the entry point function. 2013-11-25 02:00:00 +00:00
trivial.test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
unknown-drectve.test [PECOFF] Report error if there's unknown flag in .drectve 2013-11-05 23:53:15 +00:00
weak-external.test [PECOFF] Add file extensions to temporary files. 2013-12-27 08:37:40 +00:00