* Factored values used in the ELF header into constants, so they can be reused when reading object files.
* Writing first 16 bytes of ELF header should be endian-neutral.
* Section symbols must have st_name equal to zero, using section shstridx is incorrect because it is an index into .shstrtab, not into .strtab (actually written content is unchanged, because section_write_symbol is called while shstridx is still zero).
git-svn-id: trunk@21455 -
* Enable smart linking on go32v2
* Adapted external linker script for long section names (ld 2.17 from fpcbuild repository does not seem to actually remove unused sections though)
* Do not pass '-lc' twice to external linker
* Pass -Map with correct filename to external linker if -Xm is specified on command line
* Debug sections for DJCOFF must have zero memory position and flag COFF_STYP_INFO (not COFF_STYP_NOLOAD).
git-svn-id: trunk@21435 -
- Support MLA and MUL in DataMov2Data
- SMLAL and UMLAL are also reading from oper[0]
- UMLAL, UMULL, SMLAL and SMULL are writing to oper[1]
git-svn-id: trunk@21421 -
* Fixed header data positions for DJCOFF executables, they need adjustment by stub size.
* Fixed symbol values in DJCOFF executables, they must be absolute.
* Fixed missing oso_common flag on TExeOutput.commonObjSection, causing incorrect COFF relocations to this section.
git-svn-id: trunk@21408 -
* Assign section indexes independent from symbol indexing.
* Fixed section flags not assigned while reading DJGPP object files.
* Fixed objData type for TDJCoffexeoutput.
* Fixed entry point address of DJGPP executables.
* Fixed filling exe section headers for DJGPP.
git-svn-id: trunk@21396 -
and if the result does not depend on the types of the arguments (to
prevent "qwordconst>int64const" being turned into
"int64(qwordconst)>int64const" and thereby potentially change the outcome)
(mantis #19622)
git-svn-id: trunk@21395 -
simplified via typeconvnode (corrects resultdef of "qword(1) shl 33",
mantis #22133)
* simplify shl/shr nodes after their resultdef has been set, so the
resultdef used during simplify is set (fixes same expression as above
when it is calculated by an inline function)
git-svn-id: trunk@21394 -
and also use this code to trash local variables in inlined routines
o fixes mantis #22088
o makes it possible to also implement it for the jvm target in the future
git-svn-id: trunk@21393 -
method is only used anymore internally in cgobj.tcg and its descendants
* made tcg.g_indirect_sym_load() protected to ensure it stays that way
git-svn-id: trunk@21392 -
- removed empty destructor and checks for nil before .Free (they are done in tobject.free itself)
+ added COMDAT definitions.
git-svn-id: trunk@21383 -
type conversions (those should always re-interpret the raw bits),
except for variants (because those are sometimes generated internally)
-- done so that -gt code at the node tree level can insert explicit
typecasts to integer types without triggering overloaded explicit
typecast operators such as in tests/test/terecs14
git-svn-id: trunk@21381 -
Reorder unaligned Load sequence on ARM
The old version produced code like that:
ldrb rDEST, [rBASE]
ldrb rTemp, [rBASE, #1]
orr rDEST, rDEST, rTEMP lsl #8 (2 stall cycles)
ldrb rTemp, [rBASE, #2]
orr rDEST, rDEST, rTEMP lsl #16 (2 stall cycles)
ldrb rTemp, [rBASE, #3]
orr rDEST, rDEST, rTEMP lsl #24 (2 stall cycles)
This creates a lot of stall-cycles on ARM Implementations with load
delay slots like Marvel Kirkwood or Intel XScale. With the usual up to 2
stall-cycles this code requires a total of 13 cycles (7 instructions + 6 stall
cycles) in best case.
The new code uses a second temp register to avoid the stall cycles.
ldrb rDEST, [rBASE]
ldrb rTemp1, [rBASE, #1]
ldrb rTemp2, [rBASE, #2]
orr rDEST, rDEST, rTEMP1 lsl #8
ldrb rTemp1, [rBASE, #3]
orr rDEST, rDEST, rTEMP2 lsl #16
orr rDEST, rDEST, rTEMP1 lsl #24 (1 stall cycle)
The rescheduling and second register bring the total cycles down to 8.
If a later rescheduling should happen for the last orr it even can go
down to 7.
git-svn-id: trunk@21363 -
* symtable.pas:
+ add function "get_generic_in_hierarchy_by_name" which returns a def with the name of the symbol in the given object/record hierarchy (useful only in non-Delphi modes)
+ add function "return_specialization_of_generic" which returns the specialization def of a given class inside the given object/record hierarchy
* pexpr.pas, factor, factor_read_id: instead of checking whether the names of the found symbol and the current_structdef are equal, check whether the generic appears in hierarchy of current_structdef
* ptype.pas:
* id_type: check whether the found symbol is a generic dummy and we are currently parsing a generic then return the correct def of the generic instead of the dummy one
* single_type: when using the generic type without type parameters the def must resolve to the specialized def when specializing the class instead of the generic def which the dummy symbol points to
* read_named_type, expr_type: like in "single_type" we need to resolve the use of the parameterless type name to the correct specialization def instead of the generic def
* pdecobj.pas, object_dec: also set the typesym of the current_structdef as otherwise some assumptions about generics with the above mentioned changes aren't valid anymore (like the def the typesym is unset again afterwards)
+ add tests for both bug reports (the one for 19499 is slightly modified so that it does not contain any errors)
git-svn-id: trunk@21361 -
contents of a procvar had to be loaded in case of a procedure of object
or nested procvar rather than only the code address (harmless, because
this code is only active for low level targets currently and since
r21330 the location's size was used because the source and destination
types were the same)
git-svn-id: trunk@21352 -
Optimize ARM OP_MUL/OP_IMUL for x*ispowerof2(const+1) cases
Calculations like a*7 can be optimized to a*8-a with the usage of RSB and left
shifts which can be done in a single cycle.
git-svn-id: trunk@21351 -
rather than with single/double quotes depending on the target platform
(ld only supports double quotes), and rather than only quoting when
necessary (wastes time since quotes are always allowed, and double
quotes inside a directory name cannot be escaped for ld; they are
simply not supported by the program) (mantis #22059, follow-up to
r21069 and r21208)
git-svn-id: trunk@21343 -
target the AIX linker
* never quote file names added to link.res when it's not a linkerscript
(only newline is a separator in the case)
git-svn-id: trunk@21342 -
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used
git-svn-id: trunk@21335 -