Commit Graph

211 Commits

Author SHA1 Message Date
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
nickysn
f3d5bf3743 * the result of tobjsymbol.address changed from 'aword' to 'qword' as well
git-svn-id: trunk@31414 -
2015-08-25 00:19:26 +00:00
nickysn
8977c0fc78 * TExeSection.Size and .DataPos changed from aword to qword, because:
1) aword follows the ALU size of the CPU, not the address type
  2) MemPos is qword and is already checked against MaxMemPos

git-svn-id: trunk@31413 -
2015-08-25 00:08:02 +00:00
nickysn
ba1c494cd6 * the code for displaying a symbol address in the linker map file moved to a
method in TObjSymbol

git-svn-id: trunk@31411 -
2015-08-24 22:12:00 +00:00
nickysn
d8f88599de + support REL_DGROUP and REL_DGROUPREL in TExeOutput.RemoveUnreferencedSections
git-svn-id: trunk@31391 -
2015-08-24 17:25:33 +00:00
nickysn
f182a98d7b * also preserve TObjSymbol.group when updating external with global symbols
git-svn-id: trunk@31376 -
2015-08-24 00:25:37 +00:00
nickysn
b74a104e48 * instantiate TObjSectionGroup through a class type, to allow using a child
class for certain object formats

git-svn-id: trunk@31360 -
2015-08-22 11:27:22 +00:00
nickysn
9aeb94676c + added virtual method to tobjsection for returning a string representation of
the section's base address for the internal linker map file
* implemented it for omf sections to return the address in 'seg:ofs' format

git-svn-id: trunk@31359 -
2015-08-21 16:21:16 +00:00
nickysn
a762532ae1 * changed the MemPos field in TObjSection and TExeSection from aword to qword:
1) aword follows the ALU size of the CPU, not the address size
  2) it is already qword in TExeOutput and its methods and there's already
     MaxMemPos to check if the limits of the platform/exe format have been
     exceeded

git-svn-id: trunk@31357 -
2015-08-21 14:13:27 +00:00
nickysn
515d702408 - removed semicolon after 'begin'
git-svn-id: trunk@31314 -
2015-08-11 14:30:32 +00:00
nickysn
9fc100574c + added property TObjSymbol.group for use with the omf object format
git-svn-id: trunk@31312 -
2015-08-11 13:38:28 +00:00
nickysn
0da38dbc79 + implemented support for the 'dgroup' (addr_dgroup) relocation type in the omf
internal object writer

git-svn-id: trunk@30800 -
2015-05-04 17:07:19 +00:00
nickysn
bde7d0aacb + added "code segment too large" and "data segment too large" error messages
git-svn-id: trunk@30687 -
2015-04-20 23:47:22 +00:00
nickysn
a7e059c875 + support segment relocations in the omf writer
git-svn-id: trunk@30600 -
2015-04-14 22:46:01 +00:00
nickysn
393b9b54a8 + handle aitconst_farptr in the internal asm writer as a new relocation type (RELOC_FARPTR)
git-svn-id: trunk@30456 -
2015-04-05 23:43:37 +00:00
Jeppe Johansen
52e505bff7 Fixed internal error in GOT related code for ARM internal assembler.
git-svn-id: trunk@30188 -
2015-03-14 16:03:16 +00:00
Jeppe Johansen
71cdedea82 Add missing NOP, and B instruction forms.
Move ThumbFunc flag from section to symbol.
Make .w forms optional the other way around. If .w is explicitly put on an instruction the assembler should always chose a wide form.

git-svn-id: branches/laksen/armiw@29341 -
2014-12-27 13:23:02 +00:00
Jeppe Johansen
de00a1d76d Implement simple support for .thumb_func in the ELF output.
git-svn-id: branches/laksen/armiw@29340 -
2014-12-27 11:02:38 +00:00
Jeppe Johansen
5c3093a937 Add most non-VFP Thumb-2 instruction entries for the ARM internal writer.
git-svn-id: branches/laksen/armiw@29329 -
2014-12-26 18:35:15 +00:00
Jeppe Johansen
9e5979e8be Implemented UAL syntax support in the ARM assembler reader. Can be toggled with a field for now, but not implemented yet. Still using pre-UAL syntax for now.
Switched codegeneration of VFPv2 and VFPv3 to use UAL mnemonics and syntax.
Updated VFP code in RTL to use UAL syntax too.
Added preliminary ELF support for ARM.
Added support for linking of WinCE COFF files. Should work for with a standard ARMv4-I target.

git-svn-id: branches/laksen/armiw@29247 -
2014-12-10 20:44:34 +00:00