Commit Graph

309 Commits

Author SHA1 Message Date
Michael J. Spencer be03e2a861 [Core,Driver,ELF] Differentiate static and dynamic executables.
This also adds a simple relocation change for dynamic executables to
x86-64 ELF.

llvm-svn: 175208
2013-02-14 20:32:00 +00:00
Michael J. Spencer db18847b01 [ELF][Writer] Refactor Section to not have atoms. Move atoms into AtomSection.
The purpose of this change is to simplify creating non-atom sections.
Previously _contentType, _sectionKind and _order were used for multiple
purposes and collided in places. This moves all of the Atom specific logic down
into AtomSection and makes Section just have raw Elf_Shdr flags.

llvm-svn: 175207
2013-02-14 20:24:38 +00:00
Shankar Easwaran 4b9cea7317 fix the mergeable string atom, when the target points to a symbol which is at a relative offset from the start of the .rodata section
llvm-svn: 175039
2013-02-13 06:35:33 +00:00
Shankar Easwaran 96d594b14e add merge strings option, this temporarily fixes the problem bringing up helloworld with glibc on x86_64
llvm-svn: 175038
2013-02-13 06:12:52 +00:00
Shankar Easwaran 0da6d71b54 add support for merging common strings
llvm-svn: 174990
2013-02-12 18:46:53 +00:00
Michael J. Spencer c3c8bc1e5c [ELF] Add support for reading dynamic libraries.
llvm-svn: 174916
2013-02-11 23:03:35 +00:00
Shankar Easwaran 710b4c8fa2 fix segment ordering of elf segments
llvm-svn: 174659
2013-02-07 20:33:55 +00:00
Shankar Easwaran 34ab70f1e6 add changes for layoutafter/layoutbefore/ingroup/layoutpass and test cases
llvm-svn: 174658
2013-02-07 20:16:12 +00:00
Michael J. Spencer ac4f444e39 [docs] lld self hosts.
llvm-svn: 174592
2013-02-07 07:26:45 +00:00
Michael J. Spencer 7799d15f6e [Driver] Add -L and -l support.
llvm-svn: 174590
2013-02-07 06:47:17 +00:00
Michael J. Spencer cfe59fd0d3 [Driver] Replace Target with TargetInfo. Simplify LinkerInput.
This removes Target and moves the functionality it had over to TargetInfo.

This also simplifies LinkerInput by removing the InputKind. This will be handled elsewhere.

llvm-svn: 174589
2013-02-07 06:46:48 +00:00
Michael J. Spencer 7a0e212f6f [ELF][x86-64] Handle PLT32 relocations to IFUNC.
llvm-svn: 174428
2013-02-05 19:15:03 +00:00
Michael J. Spencer 7fec00b20e [ELF][Layout] Provide a proper way to get the TLS segment size.
llvm-svn: 174427
2013-02-05 19:14:43 +00:00
Michael J. Spencer 359b6ff6bb [ELF] Implement GOTPCREL for defined atoms.
llvm-svn: 174426
2013-02-05 19:14:28 +00:00
Michael J. Spencer e6ab9f80a7 [ELF] Replace local dynamic tls access with direct access.
llvm-svn: 174425
2013-02-05 19:14:07 +00:00
Michael J. Spencer be1100e192 [Resolver] Improve undefined symbol error.
llvm-svn: 174277
2013-02-03 10:50:06 +00:00
Michael J. Spencer 7b7e8edb86 [ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.
llvm-svn: 174276
2013-02-03 10:49:57 +00:00
Michael J. Spencer 7e813242af [ELF][Reader] Improve performance by removing calls to malloc.
llvm-svn: 174275
2013-02-03 10:49:47 +00:00
Michael J. Spencer 9a1da075b2 [ELF] Fix uninitialized variable.
llvm-svn: 174274
2013-02-03 10:49:37 +00:00
Michael J. Spencer 4673da27ef [Archive] Update to LLVM change.
llvm-svn: 174273
2013-02-03 10:49:26 +00:00
Alex Rosenberg b65e88863e Spelling and grammar corrections.
llvm-svn: 174268
2013-02-03 07:05:26 +00:00
Shankar Easwaran a47495898c remove duplicate strings from the string table
llvm-svn: 174200
2013-02-01 18:06:15 +00:00
Shankar Easwaran d476528e3d add alignment to .got/.got.plt/.plt sections & fix tests
llvm-svn: 174199
2013-02-01 18:03:32 +00:00
Shankar Easwaran f23fc86ca8 add proper copyright header
llvm-svn: 174178
2013-02-01 15:05:11 +00:00
Michael J. Spencer 18950a174e [Docs] Update status :)
llvm-svn: 174162
2013-02-01 09:20:24 +00:00
Michael J. Spencer 08b49bf27e [ELF][x86-64] Fix ifunc and add test.
In an previous commit I managed to completely disable the IRELATIVE relocation
writing code. I also used the wrong addend for the static relocation. Fix both
these issues and add a test. This test is quite brittle because there's no way
to do arithmetic on variables in FileCheck.

llvm-svn: 174161
2013-02-01 09:14:21 +00:00
Michael J. Spencer b5d6f5e988 [ELF][x86-64] Implement static relocation model for TLS.
This implements the static relocation model for GOT accesses to TLS.

llvm-svn: 174155
2013-02-01 07:14:14 +00:00
Michael J. Spencer b0ed8e80d8 [ELF][x86-84] Add static TLS support.
llvm-svn: 174154
2013-02-01 07:13:49 +00:00
Michael J. Spencer 3c75665fdd [ELF][x86-64] Add the _GLOBAL_OFFSET_TABLE_ Atom in the correct location.
Now we link against glibc without --noinhibit-exec.

llvm-svn: 174150
2013-02-01 05:36:14 +00:00
Michael J. Spencer c8803d27aa [ELF] Add more absolute atoms. Simplify how they are resolved.
llvm-svn: 174149
2013-02-01 05:36:00 +00:00
Shankar Easwaran 73ef70b50f add hexagon scatter bits and split hexgontargethandler to hexagonrelocationhander
llvm-svn: 174148
2013-02-01 05:26:02 +00:00
Michael J. Spencer 280dadbbaf [Core] Only complain about undefined symbols if they are marked as canBeNullNever.
llvm-svn: 174107
2013-01-31 22:56:13 +00:00
Michael J. Spencer 461d33648b [ELF][x86-64] Improve unknown relocation message.
llvm-svn: 174092
2013-01-31 21:00:57 +00:00
Michael J. Spencer 3830d2c49f [ELF] Create atoms for progbits sections with no symbols but still have content.
llvm-svn: 174091
2013-01-31 21:00:42 +00:00
Shankar Easwaran fb8565a9c6 add support for assigning virtual addresses to TDATA/TBSS sections
llvm-svn: 174065
2013-01-31 16:04:47 +00:00
Michael J. Spencer b3c04d28c8 [ELF] Fix circular initialization bug.
llvm-svn: 173968
2013-01-30 20:36:56 +00:00
Michael J. Spencer 901fd6a4c8 [ELF] Use the target's LayoutHandler.
llvm-svn: 173966
2013-01-30 20:05:27 +00:00
Shankar Easwaran e07245cdfc hexagon targetinfo changes for getting the relocation kind from string and vice versa
llvm-svn: 173942
2013-01-30 16:05:43 +00:00
Shankar Easwaran ddb122811b simplify hexagon relocations handling
llvm-svn: 173938
2013-01-30 15:38:41 +00:00
Michael J. Spencer 23d23953b3 [ELF][x86-64] Add TargetLayout.
llvm-svn: 173922
2013-01-30 10:43:25 +00:00
Michael J. Spencer 8254185eea Whitespace.
llvm-svn: 173921
2013-01-30 10:43:10 +00:00
Michael J. Spencer d21b72730f [ELF] Remove ReferenceKinds.
llvm-svn: 173912
2013-01-30 07:46:54 +00:00
Michael J. Spencer f35c3e434a [ELF] Use TargetRelocationHandler to apply relocations.
llvm-svn: 173911
2013-01-30 07:46:31 +00:00
Michael J. Spencer 409a737f36 [ELF] Add {Hexagon,PPC,X86}TargetHandler.
llvm-svn: 173909
2013-01-30 07:36:45 +00:00
Shankar Easwaran 072031a265 change the function names in RelocationHelper to adhere to convention
llvm-svn: 173908
2013-01-30 07:36:09 +00:00
Shankar Easwaran 396e4c0b13 change DefaultLayout to TargetLayout inside member variables
llvm-svn: 173906
2013-01-30 07:19:57 +00:00
Shankar Easwaran a6f00fe083 add targethandler hooks from Writer and cleanup
llvm-svn: 173904
2013-01-30 07:11:43 +00:00
Michael J. Spencer 457a77739b [ELF][x86-64] Add X86_64TargetRelocationHandler and friends.
llvm-svn: 173897
2013-01-30 05:26:03 +00:00
Michael J. Spencer 4e9d9cd23b [ELF] Add ELFTargetRelocationHandler.
llvm-svn: 173896
2013-01-30 05:25:44 +00:00
Shankar Easwaran a51870b143 add Relocation helper functions
llvm-svn: 173895
2013-01-30 04:49:54 +00:00