Yasm Assembler mainline development tree (ffmpeg 依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
106 B

Massive cleanup of relocation and WRT handling. Closes #49 and lays the groundwork for further features and possible cleanups. Note: this commit changes the way in which relocations in the COFF/Win32/Win64 target can be forced to reference a different symbol than is being pointed to; instead of the ambiguous "trap+(trap.end-trap)" to get the reloc to point at trap.end but reference the trap symbol, after this commit "trap.end wrt trap" is the way to say this. This also reads a lot more clearly and is not ambiguous. This should really only affect people who write .pdata sections for Win64. See the objfmts/win64/tests/win64-dataref.asm testcase for an example of usage. This cleanup adds a new data structure, yasm_value, which is used for all expressions that can be potentially relocatable. This data structure splits the absolute portion of the expression away from the relative portion and any modifications to the relative portion (SEG, WRT, PC-relative, etc). A large amount of code in the new value module breaks a general expression into its absolute and relative parts (yasm_value_finalize_expr) and provides a common set of code for writing out non-relocated values (yasm_value_output_basic). All bytecode handling in both libyasm and the architecture modules was rewritten to use yasm_values when appropriate (e.g. data values, immediates, and effective addresses). The yasm_output_expr_func is now yasm_output_value_func and all users and implementors (mainly in object formats) have been updated to handle yasm_values. Simultaneously with this change, yasm_effaddr and yasm_immval full structure definitions have been moved from bc-int.h to bytecode.h. The data hiding provided by bc-int.h was relatively minimal and probably overkill. Also, great simplifications have been made to x86 effective address expression handling. svn path=/trunk/yasm/; revision=1419
19 years ago
-:2: effective address too complex
-:3: immediate expression too complex
Revamp error/warning handling, using a model similar to Python's internal exception handling. There are now two layers an error or warning goes through before it hits the user: first an error is logged via yasm_error_set() (or yasm_warn_set() for a warning). Only one error may be set, whereas multiple warnings can be set (yasm_warn_set maintains a linked list). Then, calling yasm_errwarn_propagate() propagates any error and/or warning(s) to an errwarns structure and associates the errors/warnings with a line number at that time; this call also clears the pending errors/warnings and allows new ones to be set. The propagate function can safely be called when there are no pending error/warnings. In addition, there are some helper errwarn functions that allow clearing of an error/warning without propagating, getting it separately, etc. Still yet to be done: changing most/all uses of yasm_internal_error() into yasm_error_set(YASM_ERROR_ASSERTION). The main advantage this change has is making libyasm functions feel much more library like, and separating the user code line numbers from the inner function error handling (e.g. intnum create functions only needed the line number to trigger errors; this is no longer required). The set/propagate/etc functions use global data structures to avoid passing around a pointer to every function. This would need to be made thread-local data in a threaded app. Errwarns containers (that keep associated line numbers) are no longer global, so multiple source streams can be processed separately with no conflict (at least if there's only a single thread of execution). svn path=/trunk/yasm/; revision=1521
19 years ago
-:8: data expression too complex