History log of /llvm-project/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (Results 26 – 50 of 89)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3
# 0e05192d 10-Feb-2016 Colin LeMahieu <colinl@codeaurora.org>

[MC] Merge VK_PPC_TPREL in to generic VK_TPREL.

Differential Revision: http://reviews.llvm.org/D17038

llvm-svn: 260401


Revision tags: llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1
# 8340f94d 13-Jan-2016 Rafael Espindola <rafael.espindola@gmail.com>

Convert a few assert failures into proper errors.

Fixes PR25944.

llvm-svn: 257697


# 850ba46d 17-Dec-2015 Rafael Espindola <rafael.espindola@gmail.com>

Simplify. NFC.

llvm-svn: 255894


Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1
# de1dc9c9 22-Oct-2015 Bill Schmidt <wschmidt@linux.vnet.ibm.com>

[PPC] Fix PR24686 by failing assembly for an invalid relocation

PR24686 identifies a problem where a relocation expression is invalid
when not all of the symbols in the expression can be locally
res

[PPC] Fix PR24686 by failing assembly for an invalid relocation

PR24686 identifies a problem where a relocation expression is invalid
when not all of the symbols in the expression can be locally
resolved. This causes the compiler to request a PC-relative half16ds
relocation, which is nonsensical for PowerPC. This patch recognizes
this situation and ensures we fail the assembly cleanly.

Test case provided by Anton Blanchard.

llvm-svn: 251027

show more ...


# 0a7d0ad9 22-Sep-2015 NAKAMURA Takumi <geek4civic@gmail.com>

Untabify.

llvm-svn: 248264


Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1
# f00654e3 23-Jun-2015 Alexander Kornienko <alexfh@google.com>

Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)

Apparently, the style needs to be agreed upon first.

llvm-svn: 240390


# 70bc5f13 19-Jun-2015 Alexander Kornienko <alexfh@google.com>

Fixed/added namespace ending comments using clang-tidy. NFC

The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
-checks=-*,llvm-namespace-c

Fixed/added namespace ending comments using clang-tidy. NFC

The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
-checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
llvm/lib/


Thanks to Eugene Kosov for the original patch!

llvm-svn: 240137

show more ...


# 95fb9b93 02-Jun-2015 Rafael Espindola <rafael.espindola@gmail.com>

Merge MCELF.h into MCSymbolELF.h.

Now that we have a dedicated type for ELF symbol, these helper functions can
become member function of MCSymbolELF.

llvm-svn: 238864


# e3b2acf2 29-May-2015 Rafael Espindola <rafael.espindola@gmail.com>

Pass MCSymbols to the helper functions in MCELF.h.

llvm-svn: 238596


# ece40ca4 29-May-2015 Rafael Espindola <rafael.espindola@gmail.com>

Pass a MCSymbol to needsRelocateWithSymbol.

llvm-svn: 238589


Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1
# 5560a4cf 14-Apr-2015 Rafael Espindola <rafael.espindola@gmail.com>

Use raw_pwrite_stream in the object writer/streamer.

The ELF object writer will take advantage of that in the next commit.

llvm-svn: 234950


# 49286e9f 09-Apr-2015 Rafael Espindola <rafael.espindola@gmail.com>

clang-format bits of code to make a followup patch easy to read.

llvm-svn: 234519


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1
# a88b6057 12-Nov-2014 Justin Hibbits <jrh29@alumni.cwru.edu>

Add support for small-model PIC for PowerPC.

Summary:
Large-model was added first. With the addition of support for multiple PIC
models in LLVM, now add small-model PIC for 32-bit PowerPC, SysV4 AB

Add support for small-model PIC for PowerPC.

Summary:
Large-model was added first. With the addition of support for multiple PIC
models in LLVM, now add small-model PIC for 32-bit PowerPC, SysV4 ABI. This
generates more optimal code, for shared libraries with less than about 16380
data objects.

Test Plan: Test cases added or updated

Reviewers: joerg, hfinkel

Reviewed By: hfinkel

Subscribers: jholewinski, mcrosier, emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D5399

llvm-svn: 221791

show more ...


# 8c90fd71 03-Sep-2014 Benjamin Kramer <benny.kra@googlemail.com>

Add override to overriden virtual methods, remove virtual keywords.

No functionality change. Changes made by clang-tidy + some manual cleanup.

llvm-svn: 217028


Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2
# 7c8ae535 25-Jul-2014 Hal Finkel <hfinkel@anl.gov>

[PowerPC] Support TLS on PPC32/ELF

Patch by Justin Hibbits!

llvm-svn: 213960


Revision tags: llvmorg-3.5.0-rc1
# 46797c69 20-Jul-2014 Ulrich Weigand <ulrich.weigand@de.ibm.com>

[MC] Pass MCSymbolData to needsRelocateWithSymbol

As discussed in a previous checking to support the .localentry
directive on PowerPC, we need to inspect the actual target symbol
in needsRelocateWit

[MC] Pass MCSymbolData to needsRelocateWithSymbol

As discussed in a previous checking to support the .localentry
directive on PowerPC, we need to inspect the actual target symbol
in needsRelocateWithSymbol to make the appropriate decision based
on that symbol's st_other bits.

Currently, needsRelocateWithSymbol does not get the target symbol.
However, it is directly available to its sole caller. This patch
therefore simply extends the needsRelocateWithSymbol by a new
parameter "const MCSymbolData &SD", passes in the target symbol,
and updates all derived implementations.

In particular, in the PowerPC implementation, this patch removes
the FIXME added by the previous checkin.

llvm-svn: 213487

show more ...


# bb68610d 20-Jul-2014 Ulrich Weigand <ulrich.weigand@de.ibm.com>

[PowerPC] ELFv2 MC support for .localentry directive

A second binutils feature needed to support ELFv2 is the .localentry
directive. In the ELFv2 ABI, functions may have two entry points:
one for c

[PowerPC] ELFv2 MC support for .localentry directive

A second binutils feature needed to support ELFv2 is the .localentry
directive. In the ELFv2 ABI, functions may have two entry points:
one for calling the routine locally via "bl", and one for calling the
function via function pointer (either at the source level, or implicitly
via a PLT stub for global calls). The two entry points share a single
ELF symbol, where the ELF symbol address identifies the global entry
point address, while the local entry point is found by adding a delta
offset to the symbol address. That offset is encoded into three
platform-specific bits of the ELF symbol st_other field.

The .localentry directive instructs the assembler to set those fields
to encode a particular offset. This is typically used by a function
prologue sequence like this:

func:
addis r2, r12, (.TOC.-func)@ha
addi r2, r2, (.TOC.-func)@l
.localentry func, .-func

Note that according to the ABI, when calling the global entry point,
r12 must be set to point the global entry point address itself; while
when calling the local entry point, r2 must be set to point to the TOC
base. The two instructions between the global and local entry point in
the above example translate the first requirement into the second.

This patch implements support in the PowerPC MC streamers to emit the
.localentry directive (both into assembler and ELF object output), as
well as support in the assembler parser to parse that directive.

In addition, there is another change required in MC fixup/relocation
handling to properly deal with relocations targeting function symbols
with two entry points: When the target function is known local, the MC
layer would immediately handle the fixup by inserting the target
address -- this is wrong, since the call may need to go to the local
entry point instead. The GNU assembler handles this case by *not*
directly resolving fixups targeting functions with two entry points,
but always emits the relocation and relies on the linker to handle
this case correctly. This patch changes LLVM MC to do the same (this
is done via the processFixupValue routine).

Similarly, there are cases where the assembler would normally emit a
relocation, but "simplify" it to a relocation targeting a *section*
instead of the actual symbol. For the same reason as above, this
may be wrong when the target symbol has two entry points. The GNU
assembler again handles this case by not performing this simplification
in that case, but leaving the relocation targeting the full symbol,
which is then resolved by the linker. This patch changes LLVM MC
to do the same (via the needsRelocateWithSymbol routine).
NOTE: The method used in this patch is overly pessimistic, since the
needsRelocateWithSymbol routine currently does not have access to the
actual target symbol, and thus must always assume that it might have
two entry points. This will be improved upon by a follow-on patch
that modifies common code to pass the target symbol when calling
needsRelocateWithSymbol.

Reviewed by Hal Finkel.

llvm-svn: 213485

show more ...


# 3ee2af7d 18-Jul-2014 Hal Finkel <hfinkel@anl.gov>

[PowerPC] 32-bit ELF PIC support

This adds initial support for PPC32 ELF PIC (Position Independent Code; the
-fPIC variety), thus rectifying a long-standing deficiency in the PowerPC
backend.

Patch

[PowerPC] 32-bit ELF PIC support

This adds initial support for PPC32 ELF PIC (Position Independent Code; the
-fPIC variety), thus rectifying a long-standing deficiency in the PowerPC
backend.

Patch by Justin Hibbits!

llvm-svn: 213427

show more ...


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1
# 3d082fa5 03-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Fix pr19645.

The fix itself is fairly simple: move getAccessVariant to MCValue so that we
replace the old weak expression evaluation with the far more general
EvaluateAsRelocatable.

This then requi

Fix pr19645.

The fix itself is fairly simple: move getAccessVariant to MCValue so that we
replace the old weak expression evaluation with the far more general
EvaluateAsRelocatable.

This then requires that EvaluateAsRelocatable stop when it finds a non
trivial reference kind. And that in turn requires the ELF writer to look
harder for weak references.

Last but not least, this found a case where we were being bug by bug
compatible with gas and accepting an invalid input. I reported pr19647
to track it.

llvm-svn: 207920

show more ...


Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1
# 5904e12b 29-Mar-2014 Rafael Espindola <rafael.espindola@gmail.com>

Completely rewrite ELFObjectWriter::RecordRelocation.

I started trying to fix a small issue, but this code has seen a small fix too
many.

The old code was fairly convoluted. Some of the issues it h

Completely rewrite ELFObjectWriter::RecordRelocation.

I started trying to fix a small issue, but this code has seen a small fix too
many.

The old code was fairly convoluted. Some of the issues it had:

* It failed to check if a symbol difference was in the some section when
converting a relocation to pcrel.
* It failed to check if the relocation was already pcrel.
* The pcrel value computation was wrong in some cases (relocation-pc.s)
* It was missing quiet a few cases where it should not convert symbol
relocations to section relocations, leaving the backends to patch it up.
* It would not propagate the fact that it had changed a relocation to pcrel,
requiring a quiet nasty work around in ARM.
* It was missing comments.

llvm-svn: 205076

show more ...


# c03f44ca 27-Mar-2014 Rafael Espindola <rafael.espindola@gmail.com>

Remove another unused argument.

llvm-svn: 204961


# 9ab38012 27-Mar-2014 Rafael Espindola <rafael.espindola@gmail.com>

Remove unused argument.

llvm-svn: 204956


# cae3a17a 24-Mar-2014 Ulrich Weigand <ulrich.weigand@de.ibm.com>

[PowerPC] Generate little-endian object files

As a first step towards real little-endian code generation, this patch
changes the PowerPC MC layer to actually generate little-endian object
files. Th

[PowerPC] Generate little-endian object files

As a first step towards real little-endian code generation, this patch
changes the PowerPC MC layer to actually generate little-endian object
files. This involves passing the little-endian flag through the various
layers, including down to createELFObjectWriter so we actually get basic
little-endian ELF objects, emitting instructions in little-endian order,
and handling fixups and relocations as appropriate for little-endian.

The bulk of the patch is to update most test cases in test/MC/PowerPC
to verify both big- and little-endian encodings. (The only test cases
*not* updated are those that create actual big-endian ABI code, like
the TLS tests.)

Note that while the object files are now little-endian, the generated
code itself is not yet updated, in particular, it still does not adhere
to the ELFv2 ABI.

llvm-svn: 204634

show more ...


# 94bc422d 20-Mar-2014 Alexey Samsonov <samsonov@google.com>

Add llvm_unreachable after fully-covered switches to appease GCC

llvm-svn: 204318


# 7fadc0ea 20-Mar-2014 Rafael Espindola <rafael.espindola@gmail.com>

Look through variables when computing relocations.

Given

bar = foo + 4
.long bar

MC would eat the 4. GNU as includes it in the relocation. The rule seems to be
that a variable that defines a symb

Look through variables when computing relocations.

Given

bar = foo + 4
.long bar

MC would eat the 4. GNU as includes it in the relocation. The rule seems to be
that a variable that defines a symbol is used in the relocation and one that
does not define a symbol is evaluated and the result included in the relocation.

Fixing this unfortunately required some other changes:

* Since the variable is now evaluated, it would prevent the ELF writer from
noticing the weakref marker the elf streamer uses. This patch then replaces
that with a VariantKind in MCSymbolRefExpr.

* Using VariantKind then requires us to look past other VariantKind to see

.weakref bar,foo
call bar@PLT

doing this also fixes

zed = foo +2
call zed@PLT

so that is a good thing.

* Looking past VariantKind means that the relocation selection has to use
the fixup instead of the target.

This is a reboot of the previous fixes for MC. I will watch the sanitizer
buildbot and wait for a build before adding back the previous fixes.

llvm-svn: 204294

show more ...


1234