Commit Graph

230 Commits

Author SHA1 Message Date
svenbarth
61358b1eaa * it's rather useless that sectiontype2options is virtual as we can't use a class type, not to mention that the classes doing the overriding are for the internal assemblers/linkers, but we need it also for external
Thus we move the functionality of the overloads to the basemethod and remove the virtual directive; maybe we'll find a better solution in the future...

git-svn-id: trunk@44926 -
2020-04-21 06:05:06 +00:00
svenbarth
5b941e3cea + implement relocations for Aarch64 for the internal COFF linker
git-svn-id: trunk@44913 -
2020-04-21 06:04:15 +00:00
svenbarth
2a1d26cc90 * use translateable error messages for undefined symbols and also report in which object file the symbol was first found
git-svn-id: trunk@43549 -
2019-11-21 21:45:11 +00:00
florian
99ce957111 * fixed default value for progbits
git-svn-id: trunk@43430 -
2019-11-09 18:32:36 +00:00
florian
137f392c66 * parameters declared as out must be initialized
git-svn-id: trunk@43429 -
2019-11-09 18:29:14 +00:00
svenbarth
ccb169b0f1 * correctly handle PE COMDAT sections: like for the Comdat groups in ELF files the unused symbols need to be converted to externals so that relocations are handled correctly
git-svn-id: trunk@43359 -
2019-11-02 12:36:30 +00:00
svenbarth
7f8800eeb1 + add a method to TObjData to retrieve the TSectionProcBits and TSectionFlags values for a given section type
git-svn-id: trunk@43266 -
2019-10-19 15:41:37 +00:00
svenbarth
e5de269664 * change TObjData.sectiontype2options to a class function so that it can be called without an instance of TObjData
git-svn-id: trunk@43265 -
2019-10-19 15:41:33 +00:00
florian
245b58c249 + support for arm attributes
* abi notes fixed

git-svn-id: trunk@43157 -
2019-10-09 17:45:40 +00:00
florian
8ecdb2e9ca + dwarf support for tls threadvars
git-svn-id: trunk@43134 -
2019-10-05 20:48:31 +00:00
florian
16163b74ec + support for the gnu2 general-dynamic tls model on arm, use it instead of the gnu one as the gnu2 one can be relaxed (access optimizations by the linker)
+ support pic relocations in the internal assembler writer

git-svn-id: trunk@43128 -
2019-10-05 20:48:26 +00:00
florian
03dfc615dc + new relocations for arm tls
git-svn-id: trunk@43123 -
2019-10-05 20:48:21 +00:00
florian
56d91b4ca7 + support tls threadvars with the internal assembler
git-svn-id: trunk@43070 -
2019-09-25 21:19:03 +00:00
florian
14b7eaa46f + x86-64: implemented support for relocation needed by tls threadvars in the binary elf writer
git-svn-id: trunk@43067 -
2019-09-25 21:18:59 +00:00
nickysn
3ebcef32ba + introduced TExeSection.MemPosStr - a virtual method for converting the
section's memory position to string for the linker map file. This can be
  overriden e.g. for segmented exe formats.

git-svn-id: trunk@42564 -
2019-08-02 16:05:37 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
florian
27ab140dd9 + gcc_except_table section
+ support exception related sections in the default LD linker script

git-svn-id: branches/debug_eh@41285 -
2019-02-10 17:57:48 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
florian
5782acc32d * patch by J. Gareth Moreton to fix 33909
git-svn-id: trunk@39353 -
2018-07-01 12:54:30 +00:00
nickysn
f4e26f382f + added an 'index' field to TObjSectionGroup, specifying the index of the group
in the object file (similar to TObjSection.index, but for groups, instead of
  sections). Set the new index field, when writing .obj files with the internal
  omf object writer.

git-svn-id: trunk@39269 -
2018-06-21 15:51:58 +00:00
nickysn
daa47f4b7f + completed the internal debug ELF writer in TMZExeOutput.writeDebugElf (not
enabled yet)

git-svn-id: trunk@39216 -
2018-06-13 16:08:54 +00:00
nickysn
99f2f3d4b6 * changed the TObjRelocation.DataOffset and orgsize types to TObjSectionOfs instead of aword
git-svn-id: trunk@39091 -
2018-05-22 13:17:35 +00:00
nickysn
065a7b63d9 * changed the TObjSectionOfs type to be longword on i8086
+ introduced the TObjSection.SizeLimit property. This will allow setting
  different size limits for different sections (e.g. 32-bit for the dwarf
  sections, 16-bit for the regular code and data sections on i8086).

git-svn-id: trunk@39087 -
2018-05-22 09:48:28 +00:00
nickysn
584635c591 + introduce align_objsecofs; use it to align integers of type TObjSectionOfs
git-svn-id: trunk@39086 -
2018-05-22 00:20:21 +00:00
nickysn
f9748e928b * also changed the type of the 'DataPos' parameter of TObjData.layoutsections to TObjSectionOfs
git-svn-id: trunk@39085 -
2018-05-21 16:48:56 +00:00
nickysn
04129b8c6e + introduce the TObjSectionOfs type - an unsigned integer, representing an
offset in an obj file section on the current platform; equal to PUInt for now,
  but will probably change to LongWord on i8086, in order to support 32-bit
  sections (needed for dwarf debug info or when linking with 32-bit object files
  in a mixed 16-bit/32-bit application, while using the internal linker)

git-svn-id: trunk@39084 -
2018-05-21 16:31:50 +00:00
nickysn
2af5c9d508 * changed type used for section alignment from byte/shortint to longint, so the
internal object writer and the internal linker support object files with
  sections with alignment >=256

git-svn-id: trunk@37518 -
2017-10-25 15:47:29 +00:00
svenbarth
e9c40f5b24 + correctly handle COMDAT sections in COFF files (at least as long as the COMDAT selection isn't IMAGE_COMDAT_SELECT_ASSOCIATIVE or IMAGE_COMDAT_SELECT_EXACT_MATCH), fixes the .refptr problems mentioned in Mantis #30614
git-svn-id: trunk@36197 -
2017-05-12 15:57:31 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
nickysn
dd9ea88b79 * TObjSection.MemPos reverted back to qword after r33692, since it breaks the
i8086-msdos internal linker for .exe files larger than 64kb (thanks pierre for
  investigating this issue)

git-svn-id: trunk@33740 -
2016-05-21 16:45:36 +00:00
florian
f950dca8a5 * use PUInt for passing around sizes in ogbase as the width of the data type should dependent on the address size and not the ALU size
git-svn-id: trunk@33692 -
2016-05-16 07:55:09 +00:00
florian
90b284e169 + generate .debug_aranges sections for dwarf debug info: enables faster address to debug info translation
git-svn-id: trunk@33454 -
2016-04-08 20:19:59 +00:00
nickysn
87baa8c43f * in the internal assembler writer, when starting a new object file, set the
cputype to current_settings.cputype, instead of cpu_none (which indicates no
  restrictions)

git-svn-id: trunk@33142 -
2016-03-02 01:12:56 +00:00
nickysn
5576caada6 * handle the asd_cpu asd_cpu directive and keep track of the currently selected
CPU in the internal assembler

git-svn-id: trunk@33123 -
2016-02-27 00:50:01 +00:00
nickysn
db5e67c3fe + introduced a new type TRelocDataInt for use as the 'data' parameter for
TObjData.writeReloc; on i8086 it was changed to longint to allow using 32-bit
  relocations
+ added support for writing 32-bit OMF relocations

git-svn-id: trunk@32936 -
2016-01-13 17:57:36 +00:00
nickysn
e628729e1d + support 48-bit (16:32) far pointer relocations in the OMF internal linker
git-svn-id: trunk@32928 -
2016-01-11 17:50:27 +00:00
nickysn
c8e20dfe74 + added i8086-specific consts RELOC_ABSOLUTE16 and RELOC_RELATIVE16, which are
aliases for RELOC_ABSOLUTE and RELOC_RELATIVE
* use RELOC_ABSOLUTE16 and RELOC_RELATIVE16, instead of RELOC_ABSOLUTE and
  RELOC_RELATIVE in the linker-related parts of the OMF support (OMF object
  reader and MZ exe output). This will make the code more readable, when 32-bit
  relocation support is added to the linker. It will also make easier to reuse
  this code for i386, in case we add an i386 target, that uses the OMF object
  format.

git-svn-id: trunk@32923 -
2016-01-11 15:24:34 +00:00
Jeppe Johansen
1b02dd27dc Make relocation type more precise compared to output of gas.
Change and to or in case symbol in other section is not exported.

git-svn-id: trunk@32852 -
2016-01-05 07:23:20 +00:00
nickysn
0d48e5f6c7 + added support to the omf/i8086-msdos internal linker for omf relocation with
location type 3 (fltFarPointer). This isn't generated by nasm, nor by the
  internal object writer (yet), but may be generated by other
  assemblers/compilers - TASM generates it (tested with it), MASM probably also
  does.

git-svn-id: trunk@32346 -
2015-11-16 14:51:05 +00:00
nickysn
78362ed6ae * RELOC_ABSOLUTE32 made different than RELOC_ABSOLUTE on i8086 (and fixed all
the i8086 bugs, related to code that assumes that they are the same)
+ also added RELOC_RELATIVE32 on i8086
* RELOC_ABSOLUTE32 and RELOC_RELATIVE32 are not yet implemented in the OMF
  object writer and linker (and currently produce an internal error), but will
  be implemented in the future, as the OMF format supports both 16-bit and
  32-bit relocations

git-svn-id: trunk@32311 -
2015-11-13 15:56:26 +00:00
nickysn
b744c83581 + implemented support for omf fixup records with target group other than 'DGROUP' in the i8086-msdos internal linker
git-svn-id: trunk@32294 -
2015-11-12 16:40:17 +00:00
nickysn
1487236f29 + support addr_fardataseg references in the internal asm writer
git-svn-id: trunk@31511 -
2015-09-04 14:33:48 +00:00
nickysn
cbaa02e7b5 + support writing more than 1024 zeros in TObjSection.WriteZeros
git-svn-id: trunk@31505 -
2015-09-04 13:26:37 +00:00
nickysn
4a855b140a + support mixing initialized and bss data in the same object section (only in
case the section options contain the new option 'oso_sparse_data') in the
  internal object writer (needed for the huge memory model)

git-svn-id: trunk@31503 -
2015-09-04 13:16:45 +00:00
nickysn
2e6d462ff6 * omf segment class names moved to a const array in omfbase, so they can be used
(in the future) in the nasm asm writer as well

git-svn-id: trunk@31483 -
2015-09-02 14:37:20 +00:00
nickysn
919cc8377a + added class type property CObjSymbol to TExeOutput as well
git-svn-id: trunk@31426 -
2015-08-25 16:07:59 +00:00
nickysn
19aab3fd31 + i8086-msdos internal linker: write symbol addresses in segment:offset format in the linker map file
git-svn-id: trunk@31425 -
2015-08-25 14:48:08 +00:00
nickysn
046a4e4114 * allow using a TObjSymbol subclass via using a "class of" type
git-svn-id: trunk@31424 -
2015-08-25 14:32:08 +00:00