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.

61 lines
2.1 KiB

# $Id$
TESTS += bitvect_test
TESTS += floatnum_test
TESTS += leb128_test
TESTS += splitpath_test
Finally fix brokenness that was NASM imported preprocessor include path handling. The new way of doing things follows C compiler standard path searching rules in terms of relative and absolute paths in relation to source location and the current working directory. There's probably some latent bugs in this as I've not tested it on Windows yet. This should make CodeView actually usable with included files. * file.c (yasm__abspath_win, yasm__abspath_unix): Convert a relative path into an absolute path. Code moved from: * cv-symline.c (cv_make_pathname): Here (deleted). (cv_dbgfmt_add_file): Use yasm__abspath() instead. * file.h (yasm__abspath_win, yasm__abspath_unix): Prototype. (yasm__abspath): Macro pointing to right version. * file.c (yasm__combpath_win, yasm__combpath_unix): Combine two possibly relative paths (also handles absolute paths). * file.h (yasm__combpath_win, yasm__combpath_unix): Prototype. (yasm__combpath): Macro pointing to right version. * file.c (yasm__fopen_include): Where the new include search magic happens, using yasm__combpath heavily. * file.h (yasm__fopen_include): Prototype. * nasm-preproc.c: Update to use yasm__fopen_include(). * nasmlib.c (nasm_src_get_fname): Helper. * nasmlib.h (nasm_src_get_fname): Helper prototype. * nasm-preproc.c (nasm_preproc_add_dep): Don't free pointer, we need it. * splitpath_test.c: Update. * combpath_test.c: New test for yasm__combpath_*. * Mkfiles: Update config.h for yasm__abspath and yasm__combpath. svn path=/trunk/yasm/; revision=1436
19 years ago
TESTS += combpath_test
TESTS += libyasm/tests/libyasm_test.sh
EXTRA_DIST += libyasm/tests/libyasm_test.sh
More gracefully handle absolute section refernce expansion, and allow for correct detection of absolute section reference loops (fixing a crash case). This is also needed for an ongoing rewrite of reloc/value handling. * expr.c (expr_xform_bc_dist): Remove transformation of absolute section references; move in changed form into... (yasm_expr__level_tree): Here. The new code doesn't immediately calculate the distance from the start of the absolute section to the referenced symbol; rather it generates an expression for this quantity. As this actually adds new absolute section refs to the tree, we can't expand with YASM_EXPR_SYMs, otherwise we would expand multiple times. Thus we need a new YASM_EXPR_SYMEXP type that thus does not get expanded. Unfortunately this ripples changes a bit because everywhere *else* we look for YASM_EXPR_SYM, we now need to look for YASM_EXPR_SYMEXP as well... (expr_xform_bc_dist): Here. (yasm_expr__copy_except): Here. (yasm_expr_extract_symrec): Here. (yasm_expr_get_symrec): Here. (yasm_expr_print): Here. * bin-objfmt.c (bin_objfmt_expr_xform): And here. * expr-int.h (yasm_expr__type): Define new YASM_EXPR_SYMEXP. * section.h (yasm_section_abs_get_sym): To implement above, we need to get a symbol referencing the first bytecode in the absolute section. To avoid creating redundant symrecs, one is generated for us now. This function lets us get it in yasm_expr__level_tree(). * section.c (yasm_section_abs_get_sym): Implement. (yasm_section): Add necessary SECTION_ABSOLUTE data. (yasm_section_create_absolute): Create the symrec here. * absloop-err.asm: New test for absolute section reference loops. svn path=/trunk/yasm/; revision=1417
19 years ago
EXTRA_DIST += libyasm/tests/absloop-err.asm
EXTRA_DIST += libyasm/tests/absloop-err.errwarn
EXTRA_DIST += libyasm/tests/charconst64.asm
EXTRA_DIST += libyasm/tests/charconst64.errwarn
EXTRA_DIST += libyasm/tests/charconst64.hex
EXTRA_DIST += libyasm/tests/duplabel-err.asm
EXTRA_DIST += libyasm/tests/duplabel-err.errwarn
EXTRA_DIST += libyasm/tests/expr-wide-ident.asm
EXTRA_DIST += libyasm/tests/expr-wide-ident.errwarn
EXTRA_DIST += libyasm/tests/expr-wide-ident.hex
EXTRA_DIST += libyasm/tests/externdef.asm
EXTRA_DIST += libyasm/tests/externdef.errwarn
EXTRA_DIST += libyasm/tests/externdef.hex
EXTRA_DIST += libyasm/tests/incbin.asm
EXTRA_DIST += libyasm/tests/incbin.errwarn
EXTRA_DIST += libyasm/tests/incbin.hex
EXTRA_DIST += libyasm/tests/jmpsize1.asm
EXTRA_DIST += libyasm/tests/jmpsize1.errwarn
EXTRA_DIST += libyasm/tests/jmpsize1.hex
EXTRA_DIST += libyasm/tests/jmpsize1-err.asm
EXTRA_DIST += libyasm/tests/jmpsize1-err.errwarn
EXTRA_DIST += libyasm/tests/timesover-err.asm
EXTRA_DIST += libyasm/tests/timesover-err.errwarn
EXTRA_DIST += libyasm/tests/unary.asm
EXTRA_DIST += libyasm/tests/unary.errwarn
EXTRA_DIST += libyasm/tests/unary.hex
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
EXTRA_DIST += libyasm/tests/value-err.asm
EXTRA_DIST += libyasm/tests/value-err.errwarn
check_PROGRAMS += bitvect_test
check_PROGRAMS += floatnum_test
check_PROGRAMS += leb128_test
check_PROGRAMS += splitpath_test
Finally fix brokenness that was NASM imported preprocessor include path handling. The new way of doing things follows C compiler standard path searching rules in terms of relative and absolute paths in relation to source location and the current working directory. There's probably some latent bugs in this as I've not tested it on Windows yet. This should make CodeView actually usable with included files. * file.c (yasm__abspath_win, yasm__abspath_unix): Convert a relative path into an absolute path. Code moved from: * cv-symline.c (cv_make_pathname): Here (deleted). (cv_dbgfmt_add_file): Use yasm__abspath() instead. * file.h (yasm__abspath_win, yasm__abspath_unix): Prototype. (yasm__abspath): Macro pointing to right version. * file.c (yasm__combpath_win, yasm__combpath_unix): Combine two possibly relative paths (also handles absolute paths). * file.h (yasm__combpath_win, yasm__combpath_unix): Prototype. (yasm__combpath): Macro pointing to right version. * file.c (yasm__fopen_include): Where the new include search magic happens, using yasm__combpath heavily. * file.h (yasm__fopen_include): Prototype. * nasm-preproc.c: Update to use yasm__fopen_include(). * nasmlib.c (nasm_src_get_fname): Helper. * nasmlib.h (nasm_src_get_fname): Helper prototype. * nasm-preproc.c (nasm_preproc_add_dep): Don't free pointer, we need it. * splitpath_test.c: Update. * combpath_test.c: New test for yasm__combpath_*. * Mkfiles: Update config.h for yasm__abspath and yasm__combpath. svn path=/trunk/yasm/; revision=1436
19 years ago
check_PROGRAMS += combpath_test
bitvect_test_SOURCES = libyasm/tests/bitvect_test.c
bitvect_test_LDADD = libyasm.a $(INTLLIBS)
floatnum_test_SOURCES = libyasm/tests/floatnum_test.c
floatnum_test_LDADD = libyasm.a $(INTLLIBS)
leb128_test_SOURCES = libyasm/tests/leb128_test.c
leb128_test_LDADD = libyasm.a $(INTLLIBS)
splitpath_test_SOURCES = libyasm/tests/splitpath_test.c
Finally fix brokenness that was NASM imported preprocessor include path handling. The new way of doing things follows C compiler standard path searching rules in terms of relative and absolute paths in relation to source location and the current working directory. There's probably some latent bugs in this as I've not tested it on Windows yet. This should make CodeView actually usable with included files. * file.c (yasm__abspath_win, yasm__abspath_unix): Convert a relative path into an absolute path. Code moved from: * cv-symline.c (cv_make_pathname): Here (deleted). (cv_dbgfmt_add_file): Use yasm__abspath() instead. * file.h (yasm__abspath_win, yasm__abspath_unix): Prototype. (yasm__abspath): Macro pointing to right version. * file.c (yasm__combpath_win, yasm__combpath_unix): Combine two possibly relative paths (also handles absolute paths). * file.h (yasm__combpath_win, yasm__combpath_unix): Prototype. (yasm__combpath): Macro pointing to right version. * file.c (yasm__fopen_include): Where the new include search magic happens, using yasm__combpath heavily. * file.h (yasm__fopen_include): Prototype. * nasm-preproc.c: Update to use yasm__fopen_include(). * nasmlib.c (nasm_src_get_fname): Helper. * nasmlib.h (nasm_src_get_fname): Helper prototype. * nasm-preproc.c (nasm_preproc_add_dep): Don't free pointer, we need it. * splitpath_test.c: Update. * combpath_test.c: New test for yasm__combpath_*. * Mkfiles: Update config.h for yasm__abspath and yasm__combpath. svn path=/trunk/yasm/; revision=1436
19 years ago
splitpath_test_LDADD = libyasm.a $(INTLLIBS)
combpath_test_SOURCES = libyasm/tests/combpath_test.c
combpath_test_LDADD = libyasm.a $(INTLLIBS)