| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having multiple SectionChunks for each section (.text, .data,
.rdata and .bss), we could have one chunk writer that can emit any sections.
This patch does that -- removing all section-sepcific chunk writers and
replace them with one "generic" writer.
This change should simplify the code because it eliminates similar-but-
slightly-different classes.
It also fixes an issue in the previous design. Before this patch, we could
emit only limited set of sections (i.e. .text, .data, .rdata and .bss). With
this patch, we can emit any sections.
llvm-svn: 195797
|
|
|
|
|
|
| |
This reverts accidental commit r195794.
llvm-svn: 195795
|
|
|
|
| |
llvm-svn: 195794
|
|
|
|
|
|
|
|
| |
According to the PE/COFF spec, a section with IMAGE_SCN_LNK_INFO should only
appear in an object file, and not allowed in an executable. So I believe
treating it as the same way as IMAGE_SCN_LNK_INFO is the right thing.
llvm-svn: 195692
|
|
|
|
|
|
|
| |
In order not to overrun a StringRef and copy the trailing garbage, we need to
set the maximum length to be copied by strncpy.
llvm-svn: 195688
|
|
|
|
| |
llvm-svn: 195618
|
|
|
|
|
|
|
|
|
| |
This patch won't change the output because the layout of linker internal
atoms is forced by layout-{before,after} references. Ordinals of the linker
internal atoms are not currently used. (That's why it's working even if there
are atoms having the same ordinals.)
llvm-svn: 195610
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the attribute from sectionBasedOnContent to sectionCustomRequired
because its the right attribute for atoms read from COFF files to have.
COFF atoms should basically be emitted to the section having the same name
as input. Permissions/attributes should not affect that.
There's no functionality change because the writer doesn't yet use the
section name. The writer will be modified in a following patch, so that atoms
are written to its customSectionName()'s section.
llvm-svn: 195595
|
|
|
|
| |
llvm-svn: 195593
|
|
|
|
|
|
|
|
| |
If /subsystem option is not specified, the linker needs to infer it from the
entry point function. If "main" or "wmain" is defined, it's a console
application. If "WinMain" or "wWinMain" is defined, it's a GUI application.
llvm-svn: 195592
|
|
|
|
| |
llvm-svn: 195284
|
|
|
|
| |
llvm-svn: 195169
|
|
|
|
|
|
|
| |
This should improve code readability as the class definitions are now
more readable than before.
llvm-svn: 195159
|
|
|
|
|
|
| |
No need to do that in ReaderCOFF.cpp.
llvm-svn: 195109
|
|
|
|
| |
llvm-svn: 195108
|
|
|
|
|
|
|
|
|
|
| |
This patch does not change the meaning of the program, but if something's wrong
in the linker or the compiler and the control reaches to the gap of imported
function table, it will stop immediately because of the presence of INT3. If
NOP, it'd fall through to the next call instruction, which is usually a
completely foreign function call.
llvm-svn: 194860
|
|
|
|
| |
llvm-svn: 194851
|
|
|
|
| |
llvm-svn: 194847
|
|
|
|
| |
llvm-svn: 194793
|
|
|
|
| |
llvm-svn: 194791
|
|
|
|
|
|
| |
Also slightly reduces PECOFFLinkingContext's memory footprint (~128B).
llvm-svn: 194787
|
|
|
|
| |
llvm-svn: 194776
|
|
|
|
| |
llvm-svn: 194754
|
|
|
|
| |
llvm-svn: 194746
|
|
|
|
| |
llvm-svn: 194668
|
|
|
|
|
|
| |
This dependency needs to be cleaned up at some point. .directve handling needs the link.exe option parser.
llvm-svn: 194642
|
|
|
|
|
|
| |
No functionality change.
llvm-svn: 194560
|
|
|
|
| |
llvm-svn: 194556
|
|
|
|
|
|
| |
This reverts commit r194551 because it broke the buildbot.
llvm-svn: 194552
|
|
|
|
| |
llvm-svn: 194551
|
|
|
|
| |
llvm-svn: 194539
|
|
|
|
| |
llvm-svn: 194322
|
|
|
|
| |
llvm-svn: 194166
|
|
|
|
|
|
|
|
| |
These fields are for /align option. Section alignment can be set per-section
basis with /section option too. In order to avoid name conflicts, rename the
existing identifiers to become more specific. No functionality change.
llvm-svn: 194160
|
|
|
|
| |
llvm-svn: 194128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We wrapped the linker internal file with a virtual archive file, so that the
linker internal file was linked only when it's actually used. This was to avoid
__ImageBase being included to the resulting executable. __ImageBase used to
occupy four bytes when emitted to executable.
And then it turned out that the implementation of __ImageBase was wrong -- it
shouldn't have been a regular atom but an absolute atom. Absolute atoms point
to some memory location, but they don't occupy disk space themselves. So it
wouldn't increase executable size (except the symbol table.) That means that
it's OK to link the linker internal file unconditionally.
So this patch does that, removing the wrapper archive file. Doing this
simplifies the code.
llvm-svn: 194127
|
|
|
|
|
|
| |
Errors in .drectve section were silently ignored. This patch fixes the issue.
llvm-svn: 194110
|
|
|
|
| |
llvm-svn: 194037
|
|
|
|
|
|
|
|
| |
Bugs that would be caught by this assertion would also be caught by
RoundTripYAMLPass test. We've enabled the pass for PECOFF, so we can remove
this.
llvm-svn: 193886
|
|
|
|
| |
llvm-svn: 193885
|
|
|
|
| |
llvm-svn: 193883
|
|
|
|
| |
llvm-svn: 193881
|
|
|
|
|
|
|
|
|
|
|
|
| |
The data directory in the PE/COFF header consisted of list of data directory
atoms. This patch changes it -- now there's only one data directory entry that
contains former data directories. That's easier to handle in the writer as well
as to write to/read from YAML/Native files. The main purpose of this refactoring
is to enable RoundTrip tests for PE/COFF.
There's no functionality change.
llvm-svn: 193854
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r193479.
The atoms are already added to the file, so re-adding them caused the YAML
writer to write the same atoms twice. That made the YAML reader to fail with
"duplicate atom name" error.
This is not the only error we've got for RoundTripYAMLPass for PECOFF, so we
cannot enable the test yet. More fixes will come.
Differential Revision: http://llvm-reviews.chandlerc.com/D2069
llvm-svn: 193762
|
|
|
|
| |
llvm-svn: 193646
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable this for the following flavors
a) core
b) gnu
c) darwin
Its disabled for the flavor PECOFF. Convenient markers are added with FIXME
comments in the Driver that would be removed and code removed from each flavor.
llvm-svn: 193585
|
|
|
|
|
|
|
|
|
| |
__ImageBase is an absolute symbol whose address is the same as the image base
address. What we did before this patch was to create __ImageBase symbol as a
symbol whose *contents* (not location) is the image base address, which is
clearly wrong.
llvm-svn: 193565
|
|
|
|
|
|
|
| |
This change has no effect now, but will be needed to emit BSS atoms
to .bss section.
llvm-svn: 193556
|
|
|
|
| |
llvm-svn: 193479
|
|
|
|
| |
llvm-svn: 193478
|