From 6e13bb01b76f8bfc4216b733d98cd4c93ef3203a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 8 Oct 2008 07:33:10 +0000 Subject: [PATCH] Merge [2110], [2111], [2112], and [2113] from trunk. [2110]: Fix address printing in bin map file [2111]: automake build fixes [2112]: libyasm documentation fix [2113]: Fix register name lookup for printing svn path=/branches/yasm-0.7.x/; revision=2144 --- libyasm/Makefile.inc | 3 +-- libyasm/symrec.h | 1 + modules/arch/lc3b/Makefile.inc | 4 +--- modules/arch/x86/Makefile.inc | 6 ++---- modules/arch/x86/x86arch.c | 6 +++--- modules/objfmts/bin/bin-objfmt.c | 4 ++-- modules/objfmts/bin/tests/multisect/multisect1.map | 2 +- modules/objfmts/bin/tests/multisect/multisect2.map | 6 +++--- 8 files changed, 14 insertions(+), 18 deletions(-) diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index 9e82a0e3..482af05a 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -28,12 +28,11 @@ libyasm_a_SOURCES += libyasm/valparam.c libyasm_a_SOURCES += libyasm/value.c libyasm_a_SOURCES += libyasm/xmalloc.c libyasm_a_SOURCES += libyasm/xstrdup.c -libyasm_a_SOURCES += module.c +nodist_libyasm_a_SOURCES += module.c module.c: $(top_srcdir)/libyasm/module.in genmodule$(EXEEXT) Makefile $(top_builddir)/genmodule$(EXEEXT) $(top_srcdir)/libyasm/module.in Makefile -BUILT_SOURCES += module.c CLEANFILES += module.c noinst_PROGRAMS += genmodule diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 531fb018..0d1245b6 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -233,6 +233,7 @@ void yasm_symtab_print(yasm_symtab *symtab, FILE *f, int indent_level); /** Get the externally-visible (global) name of a symbol. * \param sym symbol + * \param object object * \return Externally-visible symbol name (allocated, caller must free). */ /*@only@*/ char *yasm_symrec_get_global_name(const yasm_symrec *sym, diff --git a/modules/arch/lc3b/Makefile.inc b/modules/arch/lc3b/Makefile.inc index 6fbc60ce..13cc33b8 100644 --- a/modules/arch/lc3b/Makefile.inc +++ b/modules/arch/lc3b/Makefile.inc @@ -3,15 +3,13 @@ libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.c libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.h libyasm_a_SOURCES += modules/arch/lc3b/lc3bbc.c -libyasm_a_SOURCES += lc3bid.c +nodist_libyasm_a_SOURCES += lc3bid.c YASM_MODULES += arch_lc3b lc3bid.c: $(srcdir)/modules/arch/lc3b/lc3bid.re re2c$(EXEEXT) $(top_builddir)/re2c$(EXEEXT) -s -o $@ $(srcdir)/modules/arch/lc3b/lc3bid.re -BUILT_SOURCES += lc3bid.c - CLEANFILES += lc3bid.c EXTRA_DIST += modules/arch/lc3b/tests/Makefile.inc diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index 0f682381..ef5e581d 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -5,8 +5,8 @@ libyasm_a_SOURCES += modules/arch/x86/x86arch.h libyasm_a_SOURCES += modules/arch/x86/x86bc.c libyasm_a_SOURCES += modules/arch/x86/x86expr.c libyasm_a_SOURCES += modules/arch/x86/x86id.c -libyasm_a_SOURCES += x86cpu.c -libyasm_a_SOURCES += x86regtmod.c +nodist_libyasm_a_SOURCES += x86cpu.c +nodist_libyasm_a_SOURCES += x86regtmod.c YASM_MODULES += arch_x86 @@ -49,8 +49,6 @@ x86regtmod.c: $(srcdir)/modules/arch/x86/x86regtmod.gperf genperf$(EXEEXT) BUILT_SOURCES += x86insn_nasm.c BUILT_SOURCES += x86insn_gas.c -BUILT_SOURCES += x86cpu.c -BUILT_SOURCES += x86regtmod.c CLEANFILES += x86insn_nasm.c CLEANFILES += x86insn_gas.c CLEANFILES += x86cpu.c diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index de7ba518..9ad3cda0 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -449,15 +449,15 @@ x86_reg_print(yasm_arch *arch, uintptr_t reg, FILE *f) "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; static const char *name16[] = { - "ax", "cx", "dx", "bx", "sp", "bp", "si", "di" + "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; static const char *name32[] = { - "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" + "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; static const char *name64[] = { - "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi" + "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index c0d28191..89b395b1 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -681,13 +681,13 @@ map_symrec_output(yasm_symrec *sym, void *d) yasm_section_get_data(info->section, &bin_section_data_cb); /* Real address */ - yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_set_uint(info->intn, yasm_bc_next_offset(precbc)); yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->istart); map_print_intnum(info->intn, info); fprintf(info->f, " "); /* Virtual address */ - yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_set_uint(info->intn, yasm_bc_next_offset(precbc)); yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->ivstart); map_print_intnum(info->intn, info); diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map index 68cb155e..0a56e413 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.map +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -73,6 +73,6 @@ Real Virtual Name ---- Section .bss ------------------------------------------------------------- Real Virtual Name -00000020 00000020 stack_ends +00000420 00000420 stack_ends diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map index b3cb273e..82002edb 100644 --- a/modules/objfmts/bin/tests/multisect/multisect2.map +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -55,9 +55,9 @@ vfollows: not defined ---- Section .text ------------------------------------------------------------ Real Virtual Name -0000010C 0000010C showax -0000010F 0000010F showax.top -0000011F 0000011F showax.dec_dig +0000010D 0000010D showax +00000112 00000112 showax.top +00000122 00000122 showax.dec_dig ---- Section .data ------------------------------------------------------------ -- 2.40.0