Commit Graph

72 Commits

Author SHA1 Message Date
Nikolay Nikolov
b367d7c905 + introduced TAsmData.WeakRefAsmSymbolByClass 2024-02-25 07:18:22 +02:00
Nikolay Nikolov
26a2ae92ad + introduced TAsmData.RefAsmSymbolByClass - similar to RefAsmSymbol, but allows
to create a subclass of TAsmSymbol even in the case of external symbol.
2024-02-25 07:15:23 +02:00
florian
4867d48e99 + support for .debug_loc and .debuc_loclist sections 2024-01-16 23:24:37 +01:00
Jinyang He
cda8971baa Add dwarf cfa support 2023-02-05 19:18:48 +00:00
Jonas Maebe
d0bf7acc18 llvmdbg: build hashtable to lookup llvmdecl belonging to a global variable
We need to attach the debug info to it
2022-05-21 22:32:35 +02:00
Jonas Maebe
e56b58c2b0 * factored out checks whether a procdef's symbol needs to be global, and
the generation of the procdef's asmsymbols
   o also removed unnecessary definition of procdef alias symbols for Darwin
     (they are already defined in ncgutil.alloc_proc_symbol)

git-svn-id: trunk@42341 -
2019-07-07 21:33:47 +00:00
florian
c03e4ca4e7 * get rid of current_asmdata.AsmCFI as TDwarfAsmCFI casts
git-svn-id: branches/debug_eh@41574 -
2019-03-03 16:07:11 +00:00
florian
65cece7657 + mark outmost frame in CFI
git-svn-id: branches/debug_eh@41286 -
2019-02-10 17:59:04 +00:00
florian
800ce23499 * fixed some issues to get correct values of section_count, works better than before but it is still not perfect for unknown reasons
git-svn-id: trunk@39750 -
2018-09-12 20:33:18 +00:00
svenbarth
2e1327b6b2 * use pooled constant references for the parameter locations as more often than not they're equal between multiple methdos (e.g. the Self argument is always the same)
* using this the TypInfo unit can navigate interface methods and VMT method parameters much more quickly as the latter have a constant size now

git-svn-id: trunk@39686 -
2018-08-29 19:20:31 +00:00
svenbarth
c6bfb0064f * keep track of the sections that are created in the asmlists
git-svn-id: trunk@35408 -
2017-02-10 14:38:53 +00:00
svenbarth
c1db48c8c6 * add ability to disable the generation of an indirect symbol if needed (useful if that's done by the constant builder)
Note: I'm not yet really happy with both AT_DATA_FORCEINDIRECT and AT_DATA_NOINDIRECT; maybe I should replace them with flags or something like that...

git-svn-id: trunk@35366 -
2017-01-29 17:42:00 +00:00
svenbarth
729d582822 * move the indirect symbols from al_exports to a new assembler list al_indirectglobals; otherwise compilation would fail horribly if we'd try to compile with a .def file as then the al_exports sections are ignored by the internal linker
git-svn-id: trunk@35258 -
2017-01-07 20:18:17 +00:00
Jonas Maebe
473cec9d85 * converted tnodeutils.InsertRuntimeInits() to the high level typed const
builder

git-svn-id: trunk@34443 -
2016-09-07 16:09:06 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +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
svenbarth
3971ba7898 Provide basic facilities to handle indirect symbols that are needed for proper dynamic packages support.
symconst.pas:
  + new constant suffix_indirect which will be used to denote indirect symbols
aasmbase.pas:
  * TAsmsymbind: extend by AB_INDIRECT (which is used to define an indirect symbol) and AB_EXTERNAL_INDIRECT (which is used when an unknown indirect symbol is requested)
  * asmsymbindname: adjust for TAsmsymbind changes
  + new constant asmsymbindindirect which is a set of both indirect asm symbol binds
aasmdata.pas, TAsmData:
  * DefineAsmSymbolByClass: adjust to correctly declare an indirect symbol (with suffix_indirect) if one of the indirect asm symbol binds is used
  * RefAsmSymbol: extend by a boolean parameter which is used to request an indirect symbol (usually AB_EXTERNAL_INDIRECT instead of AB_EXTERNAL)

git-svn-id: trunk@33278 -
2016-03-18 21:34:17 +00:00
Jonas Maebe
6dd06a1aae * put the code for pure assembler routines in a separate asmlist, so
we can easily use a different assembler writer for them on the
    llvm target

git-svn-id: trunk@31630 -
2015-09-12 23:32:21 +00:00
Jonas Maebe
be2f63aa97 + tasmlabel.createstatic() constructor for creating static data labels
(object-local, but not starting with (.)L, so they're still treated as
    the start of a subsection by Darwin's linker when dead-stripping)
  + tasmdata.getstaticdatalabel() that uses the above

git-svn-id: branches/hlcgllvm@30338 -
2015-03-27 21:25:40 +00:00
Jonas Maebe
560fe24c44 + getlocaldatalabel()
git-svn-id: branches/hlcgllvm@30337 -
2015-03-27 21:25:37 +00:00
Jonas Maebe
687bb15299 * renamed getdatalabel() to getglobaldatalabel
git-svn-id: branches/hlcgllvm@30336 -
2015-03-27 21:25:34 +00:00
Jonas Maebe
697552b9f1 * disabled hints/warnings about changed symbol visibility by default, use
-dextdebug to see them. This fixes 4 tests.

git-svn-id: trunk@29487 -
2015-01-16 20:08:48 +00:00
pierre
a959b1a6ef Add Warning/Hint if changing bind type after assembler symbol has
been used already.
  Warning if from Global to local, temporarily downgraded to Note
to avoid faling cycle as -Sew is default.

git-svn-id: trunk@29449 -
2015-01-12 12:19:25 +00:00
pierre
87b9c1b2ea Possible fix for the OpenSolaris x86_64 cycle failure, due to bind change from AB_GLOBAL back to AB_LOCAL after code generation, which lead to invalid code
git-svn-id: trunk@29431 -
2015-01-10 22:55:11 +00:00
sergei
a3c439c60f - No longer insert BlockStart markers into asmlists. The presence of these markers disrupts peephole optimizations and require additional checks all over the place, causing various workarounds/hacks (like TAsmList.Create_without_marker) to start building up.
A more radical approach is to remove them altogether. Tested with i386-win32 (the oldest peephole optimizer), mips-linux (the newest one) and arm-linux (the most complex one) targets. The fallout was limited to two minor issues fixed in r28629 and r28708, respectively.

git-svn-id: trunk@28711 -
2014-09-22 21:33:50 +00:00
sergei
d25330e367 * Removed tasmdata.realname (it is not used anywhere) and changed tasmdata.name to pshortstring. The name string is owned by tmodule and referenced by tasmdata. This removes 80-char limit on tasmdata.name, Mantis #25009.
git-svn-id: trunk@25523 -
2013-09-19 10:06:43 +00:00
nickysn
7ae9c5b668 + added optional Tasmsymtype parameter to TAsmData.RefAsmSymbol and WeakRefAsmSymbol to allow specifying things like AT_DATA for external symbols that reside in the data segment, which is needed for i8086 medium and compact memory models
git-svn-id: trunk@25242 -
2013-08-11 19:24:54 +00:00
Jeppe Johansen
2d823452b7 The scheduler pass of the ARM optimizer left markers in the instruction list, which could prevent further peephole optimizations
git-svn-id: trunk@24781 -
2013-06-02 16:37:41 +00:00
florian
9375529430 + put guids in a constant pool as well
git-svn-id: trunk@24061 -
2013-03-29 18:48:55 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
pierre
971cc159f9 Using global assmelber labels for debug line is not required for smartlinked sections
git-svn-id: trunk@22346 -
2012-09-06 15:44:38 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
Jonas Maebe
3380b58695 * when we get near the limit of the maximum number of TOC entries that can
be generated for a single object file on AIX, automatically switch to
    an indirection scheme that uses much less TOC entries, but is slower to
    access global variables
  * manually merged infrastructure for target-specific code generation
    switches from JVM branch (-CTxxx switches)
  * -CTsmalltoc switch for AIX that forces the indirection scheme for TOC
    entries from the start in case the automatic one does not conserve
    a sufficient amount (or in case you bump up against the global TOC
    entries limit during linking)

git-svn-id: trunk@20963 -
2012-04-21 20:17:46 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
cc4169ef68 * don't raise an internalerror when the the binding type of a weak external
symbol is changed to something else (binding a weak symbol to a real
    implementation in the current file is valid)

git-svn-id: trunk@20834 -
2012-04-11 18:06:00 +00:00
paul
4cf5e36ce7 compiler:
- add TTagHashSet class descendant of THashSet with an ability to has also a LongWord value together with key
  - change TAsmData.ConstPools[] to be an indexed property to properly initialize ConstPool class, remove pool initialization from all other units
  - add ansistring constants to pool together with their encoding to distinct the same text constants with different codepage
  + test

git-svn-id: trunk@19261 -
2011-09-28 01:18:43 +00:00
pierre
ccb0595971 * Extend global label for smart linked objects to bsd systems
git-svn-id: trunk@19236 -
2011-09-25 19:30:35 +00:00
pierre
0d15a427c2 * Consider cs_create_smart instead of cs_link_smart for
use of global labels for alt_dbgline type.

git-svn-id: trunk@19062 -
2011-09-14 12:14:52 +00:00
sergei
689d4b3ecc + Mantis #19651: Generate table of typed string constants which are initialized with resourcestrings, so they are updated when SetResourceStrings or SetUnitResourceStrings is called.
git-svn-id: trunk@18968 -
2011-09-04 16:01:26 +00:00
Jonas Maebe
ce88df680b + symansistr conditional define that, when activated, makes the symbol/
mangled name handling ansistring rather than pshortstring based (required
    for JVM target; little effect on speed, some extra memory usage)

git-svn-id: branches/jvmbackend@18597 -
2011-08-20 08:13:50 +00:00
sergei
1470d91ba1 * Optimized pooling of floating point and large set constants using hash tables.
git-svn-id: trunk@17769 -
2011-06-19 21:41:41 +00:00
Jonas Maebe
d1ed076618 * changed r16080 so that global debug labels are only created on linux
systems when smart linking and PIC are on, because on Darwin this
    breaks smart linking and it's not necessary there (probably should be
    disabled completely and the problem should be solved in another way)
    (mantis #17593)

git-svn-id: trunk@16122 -
2010-10-10 13:39:46 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
pierre
292e85a59a * Partial fix for i386 linux PIC code generation
git-svn-id: trunk@16080 -
2010-10-05 08:07:15 +00:00
Jonas Maebe
99aece6230 * cleaned up handling of Darwin non-lazy pointer sections: create sections
as needed, instead of once when initialising the list (currently nothing
    else is added to that asmlist so it was safe, but it was not robust)

git-svn-id: trunk@15742 -
2010-08-08 12:39:16 +00:00
Jonas Maebe
356026f849 * use new_section() instead of tai_section.create() everywhere
- sort of reverted r14134, which is no longer required after the above
    change (new_section() inserts the alignment itself)
  * made the tai_section.create() constructor private so it cannot be
    called directly anymore

git-svn-id: trunk@15482 -
2010-06-26 10:50:14 +00:00
florian
b5e7b3e1e7 o patch by Sergei Gorelkin which basically resolves #14308 (still misses some tests):
* constant widestrings must be allocated and copied at program start up through an api call else they couldn't be passed between progam/dlls

git-svn-id: trunk@14432 -
2009-12-13 10:03:30 +00:00