4096 Commits

Author SHA1 Message Date
Guillaume Chatelet
171a74f197 [Alignment] Introduce llvm::Align to MCSection
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, JDevlieghere

Subscribers: arsenm, sdardis, jvesely, nhaehnle, sbc100, hiraditya, aheejin, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371831 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:29:59 +00:00
Guillaume Chatelet
fff5baa19a [Alignment] Move OffsetToAlignment to Alignment.h
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, JDevlieghere, alexshap, rupprecht, jhenderson

Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371742 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 15:20:36 +00:00
Tim Northover
a8e37d1bbb AArch64: support arm64_32, an ILP32 slice for watchOS.
This is the main CodeGen patch to support the arm64_32 watchOS ABI in LLVM.
FastISel is mostly disabled for now since it would generate incorrect code for
ILP32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371722 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 10:22:23 +00:00
Fangrui Song
69774a3a96 [ELF][MC] Set types of aliases of IFunc to STT_GNU_IFUNC
```
.type  foo,@gnu_indirect_function
.set   foo,foo_resolver

.set foo2,foo
.set foo3,foo2
```

The types of foo2 and foo3 should be STT_GNU_IFUNC, but we currently
resolve them to the type of foo_resolver. This patch fixes it.

Differential Revision: https://reviews.llvm.org/D67206
Patch by Senran Zhang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371312 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 14:58:47 +00:00
Jonas Devlieghere
e9377b9227 [MC] Fix undefined behavior in MCInstPrinter::formatHex
Passing INT64_MIN to MCInstPrinter::formatHex triggers undefined
behavior because the negation of -9223372036854775808 cannot be
represented in type 'int64_t' (aka 'long long'). This patch puts a
workaround in place to just print the hex value directly.

A possible alternative involves using a small helper functions that uses
(implementation) defined conversions to achieve the desirable value:

  static int64_t helper(int64_t V) {
    auto U = static_cast<uint64_t>(V);
    return V < 0 ? -U : U;
  }

The underlying problem is that MCInstPrinter::formatHex(int64_t) returns
a format_object<int64_t> and should really return a
format_object<uint64_t>. However, that's not possible because formatImm
needs to be able to print both as decimal (where a signed is required)
and hex (where we'd prefer to always have an unsigned).

  format_object<int64_t> formatImm(int64_t Value) const {
    return PrintImmHex ? formatHex(Value) : formatDec(Value);
  }

Differential revision: https://reviews.llvm.org/D67236

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371159 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 01:13:32 +00:00
Reid Kleckner
c15b5856cb [MC] Pass through .code16/32/64 and .syntax unified for COFF
These flags should simply be passed through to the target, which will do
the right thing. Add an MC/X86 test that uses these directives with the
three primary object file formats and shows that they disassemble the
same everywhere.

There is a missing test for .code32 on Windows ARM, since I'm not sure
exactly how to construct one.

Fixes PR43203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370805 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 18:16:52 +00:00
Reid Kleckner
ec8276bd72 [MC] Avoid crashes from improperly nested or wrong target .seh_handlerdata directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370540 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 22:25:55 +00:00
Reid Kleckner
b492638ac6 [X86] Print register names in .seh_* directives
Also improve assembler parser register validation for .seh_ directives.
This requires moving X86-specific seh directive handling into the x86
backend, which addresses some assembler FIXMEs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370533 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 21:23:05 +00:00
Dan Gohman
dd0b08abf0 [WebAssembly] Make __attribute__((used)) not imply export.
Add an WASM_SYMBOL_NO_STRIP flag, so that __attribute__((used)) doesn't
need to imply exporting. When targeting Emscripten, have
WASM_SYMBOL_NO_STRIP imply exporting.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370415 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 22:40:00 +00:00
Jason Liu
a080e2039a Handle local commons for XCOFF object file writing
Summary:
Adds support for emitting common local global symbols to an XCOFF object file.
Local commons are emitted into the .bss section with a storage class of
C_HIDEXT.

Patch by: daltenty

Reviewers: sfertile, hubert.reinterpretcast

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370070 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 15:14:45 +00:00
Xing Xue
325fca633f [PowerPC][AIX] Adds support for writing the .data section in assembly files
Summary:
Adds support for generating the .data section in assembly files for global variables with a non-zero initialization. The support for writing the .data section in XCOFF object files will be added in a follow-on patch. Any relocations are not included in this patch.

Reviewers: hubert.reinterpretcast, sfertile, jasonliu, daltenty, Xiangling_L

Reviewed by: hubert.reinterpretcast

Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, wuzish, shchenz, DiggerLin, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369869 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-25 15:17:25 +00:00
Benjamin Kramer
8a67530447 Do a sweep of symbol internalization. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369803 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 19:59:23 +00:00
Manoj Gupta
49a127e392 Revert r369233.
This breaks building of some projects like libfuse and alsa-lib
that now fail when linking.
Error details in PR43092.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 18:01:13 +00:00
Sean Fertile
a17efce83e [PowerPC][XCOFF][MC] Explicitly set containing csect on symbols. [NFC]
Previously we would get the csect a symbol was contained in through its
fragment. This works only if we are writing an object file, and only for
defined symbols. To fix this we set the contating csect explicitly on the
MCSymbolXCOFF object.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369657 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 15:11:23 +00:00
Sean Fertile
fe097621ce Fix assert in XCOFFObjectWriter related to program code csects.
Removed code that added program code csects to a collection as part
of addressing review comments, but I failed to update an assert affected
by the change before commiting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369471 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 23:24:47 +00:00
Sean Fertile
4cb2ee528d Remove assert with tautological compare from XCOFFObjectWriter.
Remove assert of 'Sec->getCSectType() <= 0x07u' added in r369454, since its
always true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369462 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 22:23:34 +00:00
Sean Fertile
b0e685a1a3 Adds support for writing the .bss section for XCOFF object files.
Adds Wrapper classes for MCSymbol and MCSection into the XCOFF target
object writer. Also adds a class to represent the top-level sections, which we
materialize in the ObjectWriter.

executePostLayoutBinding will map all csects into the appropriate
container depending on its storage mapping class, and map all symbols
into their containing csect. Once all symbols have been processed we
- Assign addresses and symbol table indices.
- Calaculte section sizes.
- Build the section header table.
- Assign the sections raw-pointer value for non-virtual sections.

Since the .bss section is virtual, writing the header table is enough to
add support. Writing of a sections raw data, or of any relocations is
not included in this patch.

Testing is done by dumping the section header table, but it needs to be
extended to include dumping the symbol table once readobj support for
dumping auxiallary entries lands.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369454 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 22:03:18 +00:00
Sam Clegg
d6c1c3b13a [WebAssembly][lld] Fix crash when applying relocations to debug sections
Debug sections are special in that they can contain relocations against
symbols that are not present in the final output (i.e. not live).
However it is also possible to have R_WASM_TABLE_INDEX relocations
against symbols that don't have a table index assigned (since they are
not address taken by actual code.

Fixes: https://github.com/emscripten-core/emscripten/issues/9023

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369423 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 18:39:24 +00:00
Fangrui Song
49492eee48 [MC] Delete an overload of MCExpr::evaluateKnownAbsolute and its associated hack
The hack dated back to 2010 (r121076) and was documented by r122144:

  // FIXME: The use if InSet = Addrs is a hack. Setting InSet causes us
  // absolutize differences across sections and that is what the MachO writer
  // uses Addrs for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369337 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 07:42:04 +00:00
Fangrui Song
5b0bcb21c9 MCAsmMacro: add #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) to some dump() declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369324 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 04:14:43 +00:00
Fangrui Song
e0e6b548cf [WebAssembly][MC] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r369317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369318 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 02:02:57 +00:00
Sam Clegg
81ca375398 [WebAssembly][MC] Simplify WasmObjectWriter::recordRelocation. NFC.
WebAssembly doesn't support PC relative relocation or relocation
expressions that can't be reduced to single symbol.

The only support for we have for fixups involving two symbols are when
both symbols are defined and withing the same section.  In this case
evaluateFixup will already have evaluated to the expression before
calling recordRelocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369317 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 00:33:50 +00:00
Fangrui Song
6f52bc8679 [MC] Simplify ELFObjectWriter::recordRelocation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 10:05:59 +00:00
Fangrui Song
cba87f5bd5 [MC] Delete unnecessary diagnostic: "No relocation available to represent this relative expression"
Replace

- error: No relocation available to represent this relative expression

with

+ error: symbol 'undef' can not be undefined in a subtraction expression

or

+ error: Cannot represent a difference across sections

Keep !IsPcRel as an assertion after the two diagnostic checks are done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369239 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 07:59:35 +00:00
Fangrui Song
e5de4f4e91 [MC] Don't emit .symver redirected symbols to the symbol table
GNU as keeps the original symbol in the symbol table for defined @ and
@@, but suppresses it in other cases (@@@ or undefined). The original
symbol is usually undesired:
In a shared object, the original symbol can be localized with a version
script, but it is hard to remove/localize in an archive:

1) a post-processing step removes the undesired original symbol
2) consumers (executable) of the archive are built with the
   version script

Moreover, it can cause linker issues like binutils PR/18703 if the
original symbol name and the base name of the versioned symbol is the
same (both ld.bfd and gold have some code to work around defined @ and
@@). In lld, if it sees f and f@v1:

  --version-script =(printf 'v1 {};') => f and f@v1
  --version-script =(printf 'v1 { f; };') => f@v1 and f@@v1

It can be argued that @@@ added on 2000-11-13 corrected the @ and @@ mistake.

This patch catches some more multiple version errors (defined @ and @@),
and consistently suppress the original symbol. This addresses all the
problems listed above.

If the user wants other aliases to the versioned symbol, they can copy
the original symbol to other symbol names with .set directive, e.g.

    .symver f, f@v1  # emit f@v1 but not f into .symtab
    .set f_impl, f   # emit f_impl into .symtab

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369233 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 06:17:30 +00:00
Jonas Devlieghere
114087caa6 [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369013 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 15:54:37 +00:00
David Tenty
1269c3a3b6 [NFC][AIX] Use assert instead of llvm_unreachable
Addresses post-commit comments on https://reviews.llvm.org/D64825. Use
assert instead of llvm_unreachable to check if invalid csect types are being
generated. Use report_fatal_error on unimplemented XCOFF features.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368720 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 17:04:51 +00:00
Bill Wendling
0cd6fdb032 [MC] Don't recreate a label if it's already used
Summary:
This patch keeps track of MCSymbols created for blocks that were
referenced in inline asm. It prevents creating a new symbol which
doesn't refer to the block.

Inline asm may have a reference to a label. The asm parser however
doesn't recognize it as a label and tries to create a new symbol. The
result being that instead of the original symbol (e.g. ".Ltmp0") the
parser replaces it in the inline asm with the new one (e.g. ".Ltmp00")
without updating it in the symbol table. So the machine basic block
retains the "old" symbol (".Ltmp0"), but the inline asm uses the new one
(".Ltmp00").

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368477 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 20:16:31 +00:00
Brian Cain
4f6b1719e5 [llvm-mc] Add reportWarning() to MCContext
Adding reportWarning() to MCContext, so that it can be used from
the Hexagon assembler backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368327 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 19:13:23 +00:00
David Tenty
09fb75f139 Enable assembly output of local commons for AIX
Summary:
This patch enable assembly output of local commons for AIX using .lcomm
directives. Adds a EmitXCOFFLocalCommonSymbol to MCStreamer so we can emit the
AIX version of .lcomm assembly directives which include a csect name. Handle the
case of BSS locals in PPCAIXAsmPrinter by using EmitXCOFFLocalCommonSymbol. Adds
a test for generating .lcomm on AIX Targets.

Reviewers: cebowleratibm, hubert.reinterpretcast, Xiangling_L, jasonliu, sfertile

Reviewed By: sfertile

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368306 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 15:40:35 +00:00
Hubert Tong
a23f5a25c0 [XCOFF][MC] report_fatal_error before dereferencing NULL
This patch replaces a TODO comment with a call to `report_fatal_error`.
The path that reaches the added call to `report_fatal_error` manifestly
dereferences a null pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368048 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 15:05:20 +00:00
Nilanjana Basu
c132cb0db6 Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 14:16:58 +00:00
Nilanjana Basu
e1c95d270d Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"
This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 13:55:21 +00:00
Nilanjana Basu
ed8791f244 Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 13:11:51 +00:00
Fangrui Song
2ffd08308b Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
F_{None,Text,Append} are kept for compatibility since r334221.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367800 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 05:43:48 +00:00
Daniel Sanders
0b3e53d745 Use MCRegister in MCRegisterInfo's interfaces
Summary:
As part of this, define DenseMapInfo for MCRegister (and Register while I'm at it)

Depends on D65599

Reviewers: arsenm

Subscribers: MatzeB, qcolombet, jvesely, wdng, nhaehnle, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367719 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 20:23:00 +00:00
Eric Christopher
b9ccc5854b Temporarily Revert "Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability"
This is breaking bots and the author asked me to revert.

This reverts commit 367704.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367707 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 19:10:37 +00:00
Nilanjana Basu
fec0188416 Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367704 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 18:44:39 +00:00
Sean Fertile
a24c680c53 Address post commit review comments on revision 366727.
Addresses number of comment made on D64652 after commiting:

- Reorders function decls in the TargetLoweringObjectFileXCOFF class.
- Fix comment in MCSectionXCOFF to include description of external reference
  csects.
- Convert several llvm_unreachables to report_fatal_error
- Convert several dyn_casts to casts as they are expected not to fail.
- Avoid copying DataLayout object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367324 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-30 15:37:01 +00:00
Fangrui Song
0e4182e4f1 [MC] Delete unused MCInstPrinter::markup overload and getPrintHexStyle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367000 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-25 09:54:12 +00:00
Seiya Nuta
8a53c05b3f [MC] Add MCInstrAnalysis::evaluateMemoryOperandAddress
Summary:
Add a new method which tries to compute the target address referenced by an operand.

This patch supports x86_64 RIP-relative addressing for now.

It is necessary to print referenced symbol names in llvm-objdump.

Reviewers: andreadb, MaskRay, grosbach, jgalenson, craig.topper

Reviewed By: MaskRay, craig.topper

Subscribers: bcain, rupprecht, jhenderson, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366987 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-25 06:57:09 +00:00
Sean Fertile
c20c6c1b77 Stubs out TLOF for AIX and add support for common vars in assembly output.
Stubs out a TargetLoweringObjectFileXCOFF class, implementing only
SelectSectionForGlobal for common symbols. Also adds an override of
EmitGlobalVariable in PPCAIXAsmPrinter which adds a number of defensive errors
and adds support for emitting common globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366727 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 19:15:29 +00:00
Vlad Tsyrklevich
31e0e4a6fb Revert "Reland [ELF] Loose a condition for relocation with a symbol"
This reverts commit r366686 as it appears to be causing buildbot
failures on sanitizer-x86_64-linux-android and sanitizer-x86_64-linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366708 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 17:48:53 +00:00
Nikola Prica
247dec0f5b Reland [ELF] Loose a condition for relocation with a symbol
This patch was not the reason of the buildbot failure.

Deleted code was introduced as a work around for a bug in the gold linker
(http://sourceware.org/PR16794). Test case that was given as a reason for
this part of code, the one on previous link, now works for the gold.
This condition is too strict and when a code is compiled with debug info
it forces generation of numerous relocations with symbol for architectures
that do not have relocation addend.

Reviewers: arsenm, espindola

Reviewed By: MaskRay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366686 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 13:07:01 +00:00
Hsiangkai Wang
82ea6cfac0 [DebugInfo] Some fields do not need relocations even relax is enabled.
In debug frame information, some fields, e.g., Length in CIE/FDE and
Offset in FDE are attributes to describe the structure of CIE/FDE. They
are not related to the relaxed code. However, these attributes are
symbol differences. So, in current design, these attributes will be
filled as zero and LLVM generates relocations for them.

We only need to generate relocations for symbols in executable sections.
So, if the symbols are not located in executable sections, we still
evaluate their values under relaxation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366531 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 06:10:36 +00:00
Hsiangkai Wang
b6f810717a [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.

There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366524 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 02:03:34 +00:00
Hsiangkai Wang
1b3d4c83af Revert "[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame."
This reverts commit 17e3cbf5fe656483d9016d0ba9e1d0cd8629379e.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366444 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-18 15:06:50 +00:00
Hsiangkai Wang
17e3cbf5fe [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.

There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366442 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-18 14:47:34 +00:00
Nilanjana Basu
587d5442ae Changes to display code view debug info type records in hex format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366390 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 23:43:58 +00:00
Wouter van Oortmerssen
2700151110 [WebAssembly] Assembler: recognize .init_array as data section.
Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366104 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 18:36:07 +00:00