Commit Graph

220 Commits

Author SHA1 Message Date
nickysn
a86623b97a + initialize the flags for the code and data segments in the NewExe header
git-svn-id: trunk@42588 -
2019-08-06 00:23:31 +00:00
nickysn
7132973847 + added the missing NewExe segment attributes as properties to the
TNewExeSection class and create the NewExe segment table into the .exe file.
  Not all of the properties are initialized yet, though.

git-svn-id: trunk@42587 -
2019-08-05 17:08:18 +00:00
nickysn
d7c24c05d0 + fill the segment table start offset in the NewExe header
git-svn-id: trunk@42584 -
2019-08-05 13:30:01 +00:00
nickysn
c70f2c63cd + set the initial SS:SP in the NewExe header
git-svn-id: trunk@42572 -
2019-08-03 01:04:32 +00:00
nickysn
dbafff24fe + fill the program entry point address in the NewExe header
git-svn-id: trunk@42571 -
2019-08-03 00:59:02 +00:00
nickysn
901dde5fa5 + fill the auto data segment number in the NewExe header
git-svn-id: trunk@42570 -
2019-08-03 00:42:56 +00:00
nickysn
34b3af7e92 * reset CurrMemPos after each NewExeSection to ensure each segment starts at 0 offset
git-svn-id: trunk@42569 -
2019-08-02 23:22:59 +00:00
nickysn
868030b3fe + adapted TOmfObjSection.MemPosStr to output segment:offset for NewExe executables
git-svn-id: trunk@42568 -
2019-08-02 23:01:39 +00:00
nickysn
2c176be2fd + adapted TOmfObjSymbol.AddressStr to show correct segment:offset for NewExe files as well
git-svn-id: trunk@42567 -
2019-08-02 22:47:44 +00:00
nickysn
b739d79f9b * combine the data, bss, stack and heap into the same NewExe segment
git-svn-id: trunk@42566 -
2019-08-02 16:53:16 +00:00
nickysn
1258439767 + added an TNewExeSection.MemPosStr override that outputs a segment:offset string
git-svn-id: trunk@42565 -
2019-08-02 16:14:54 +00:00
nickysn
8e436e6335 + add a segment number (MemBasePos) to TNewExeSection
git-svn-id: trunk@42563 -
2019-08-02 14:47:19 +00:00
nickysn
30e7406be3 * override MemPos_Start for the NewExe exe output and perform the whole MemPos
stage inside of it, because the linker script contains only dummy section
  names and thus none of the sections get their MemPos set, while using the
  default implementation

git-svn-id: trunk@42562 -
2019-08-02 14:32:40 +00:00
nickysn
c32ddf42eb * create NewExe sections, corresponding to 64kb segments
git-svn-id: trunk@42561 -
2019-08-02 14:20:02 +00:00
nickysn
5d01d53a96 * don't crash in TOmfObjSection.MemPosStr if MZExeUnifiedLogicalSegment isn't set
git-svn-id: trunk@42553 -
2019-08-01 16:44:46 +00:00
nickysn
93a08aaebd + write the NewExe header in TNewExeOutput.writeData
git-svn-id: trunk@42552 -
2019-08-01 16:43:39 +00:00
nickysn
d10fb705e4 + added an TNewExeOutput.Order_ObjSectionList override and sort obj sections by
class name first, then by name, then by initial order

git-svn-id: trunk@42551 -
2019-08-01 15:52:19 +00:00
nickysn
05c420fad5 + create a TNewExeSection class
git-svn-id: trunk@42546 -
2019-07-31 13:47:14 +00:00
nickysn
83861799ae + also add and resolve import symbols coming from OMF object modules
git-svn-id: trunk@42545 -
2019-07-31 13:32:43 +00:00
nickysn
d77a8fb5f4 + call TOmfObjData.AddImportSymbol for every ImpDef record read from an object file
git-svn-id: trunk@42543 -
2019-07-31 01:19:51 +00:00
nickysn
fcb6072fae + added method TOmfObjData.AddImportSymbol, which adds symbols, imported from an
external dll to TOmfObjData.ImportLibraryList (similar to
  TInternalLinker.AddImportSymbol)

git-svn-id: trunk@42542 -
2019-07-31 01:12:00 +00:00
nickysn
d2371f4176 + added an ImportLibraryList property to TOmfObjData
git-svn-id: trunk@42541 -
2019-07-31 01:05:53 +00:00
nickysn
2b6ee838f9 + implemented TNewExeOutput.GenerateLibraryImports, based on the ogcoff implementation
git-svn-id: trunk@42535 -
2019-07-30 16:34:41 +00:00
nickysn
0a94f8fc08 + parse the IMPDEF record in TOmfObjInput.ReadImpDef
git-svn-id: trunk@42346 -
2019-07-09 12:31:11 +00:00
nickysn
eea3eb1a8e + introduced the TOmfRecord_COMENT_IMPDEF class. Use it to encode the IMPDEF
records instead of encoding them directly.

git-svn-id: trunk@42236 -
2019-06-14 23:50:48 +00:00
nickysn
9fe80d7416 + use the new CC_OmfExtension_IMPDEF constant instead of the direct magic value
when writing IMPDEF records

git-svn-id: trunk@42234 -
2019-06-14 23:11:25 +00:00
nickysn
0db19546ef + dispatch the IMPDEF and EXPDEF records to the newly introduced ReadImpDef and
ReadExpDef methods (not implemented yet)

git-svn-id: trunk@42232 -
2019-06-14 23:06:58 +00:00
nickysn
d3c3f2742c + added class TNewExeOutput. Not functional yet.
git-svn-id: trunk@42225 -
2019-06-14 16:23:23 +00:00
nickysn
7871ccd054 + initialize some defaults in the TNewExeHeader constructor
git-svn-id: trunk@42224 -
2019-06-14 15:51:25 +00:00
nickysn
1474db42e4 + added class TNewExeHeader that encapsulates a NewExe header and allows writing it to a file
git-svn-id: trunk@42223 -
2019-06-14 14:16:22 +00:00
nickysn
2487fa7605 + added set TNewExeSegmentFlags
git-svn-id: trunk@42203 -
2019-06-10 13:06:58 +00:00
nickysn
465e8a99e0 + added type TNewExeAdditionalHeaderFlags
git-svn-id: trunk@42188 -
2019-06-07 14:15:07 +00:00
nickysn
ded3dec22a + added enum TNewExeTargetOS
git-svn-id: trunk@42187 -
2019-06-07 13:09:35 +00:00
nickysn
4dbccce43c + added TNewExeHeaderFlags type, describing the flags in the header of win16 executables
git-svn-id: trunk@42179 -
2019-06-06 16:00:29 +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
pierre
22ea2bd624 Avoid warnings with -O4 option
git-svn-id: trunk@40821 -
2019-01-09 22:48:08 +00:00
nickysn
635a6c7ef8 * fixed msdos .com file generation
git-svn-id: trunk@40720 -
2018-12-31 17:41:31 +00:00
florian
6a2cb0bbbd * more compilation fixes
git-svn-id: trunk@39350 -
2018-06-30 12:48:54 +00:00
nickysn
f036e67d8f * fixed the reading of OMF groups by the internal linker. Previously, it only
worked, when the files had only one group, called 'DGROUP'.

git-svn-id: trunk@39279 -
2018-06-22 17:00:23 +00:00
nickysn
45337b67fe + when using the i8086 with section based smartlinking, create OMF section
groups, named 'CGROUP' or 'CGROUP_UNITNAME', which include all the code
  sections, that need to be put in the same segment

git-svn-id: trunk@39277 -
2018-06-22 15:02:39 +00:00
nickysn
f07658d3dc * get rid of TOmfRelocation.GetGroupIndex; instead, read the index property of
the group object. This adds support for groups, other than DGROUP, when
  writing omf relocations.

git-svn-id: trunk@39276 -
2018-06-22 14:29:09 +00:00
nickysn
c8fc7c84c8 * avoid adding a section to a group twice in TOmfObjData.createsection
* add all sections, belonging to a group directly inside TOmfObjOutput.AddGroup,
  based on the TObjSectionsGroup.members array

git-svn-id: trunk@39275 -
2018-06-21 21:14:54 +00:00
nickysn
8a34bd22b8 * pass a TObjSectionGroup object as parameter to TOmfObjOutput.AddGroup, instead
of the group name

git-svn-id: trunk@39273 -
2018-06-21 20:45:52 +00:00
nickysn
d3db9e101a * don't check for the presence of the group in TOmfObjOutput.AddSegmentToGroup,
because, it is no longer possible for it to not be present (all the groups
  are added beforehand now)

git-svn-id: trunk@39272 -
2018-06-21 20:33:24 +00:00
nickysn
9a0eca52cb * changed the type of TOmfObjSection.PrimaryGroup from string to
TObjSectionGroup, so instead of holding the group's name, it now points to the
  TObjSectionGroup object, from which you can retrieve its name or any of the
  other fields and properties it contains

git-svn-id: trunk@39271 -
2018-06-21 16:28:06 +00:00
nickysn
42f06acaeb + also create the primary section group and add the newly created section to it
in TOmfObjData.createsection

git-svn-id: trunk@39270 -
2018-06-21 16:14:42 +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
ab47c8b899 + introduce the omf_section_primary_group function. Use it instead of
section_belongs_to_dgroup, to allow sections to belong to groups, other than
  dgroup.

git-svn-id: trunk@39268 -
2018-06-21 13:21:53 +00:00
nickysn
5eb69edf9e + support segments (sections) with a primary group, other than 'DGROUP' in the
OMF internal object writer

git-svn-id: trunk@39245 -
2018-06-20 14:57:20 +00:00
nickysn
7fcec8460f + parse OMF COMENT records when reading object files and produce error messages
for the records that are not supported, but are important for the executable
  being produced (such as weak/lazy externals, etc.)

git-svn-id: trunk@39241 -
2018-06-18 14:48:04 +00:00