This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Updates for improved reusability/clarity
- From: Martin Thuresson <martin at mtme dot org>
- To: binutils at sourceware dot org
- Date: Fri, 29 May 2009 13:52:47 -0700
- Subject: Updates for improved reusability/clarity
I am interested in reusing parts of binutils/gas for a project I'm
working with. The project aims at doing analysis and optimizations at
the assembly level. While working I have noticed some possible changes
that I think are beneficial for the binutils community at large. Any
feedback on these suggested changes before I submit patches are
welcome.
1:
gas defines its own assert macro in as.h. Since assert is used in
standard libraries, both in C and C++, i propose to change the name
from assert to gas_assert.
2:
In bfd/elf-bfd.h, the union gotplt_unit is defined inside struct
elf_link_hash_entry, but is then used in other structs. This does not
compile with c++. I therefor suggest to move gotplt_unit.
3:
template is a keyword in C++. I suggest to change the name of the
template types in opcodes/i386-tbl.h and include/opcode/tic54x.h to
insn_template.
4:
Currently, i386_insn is defined in gas/config/tc-i386.c. I suggest to
move it to tc-i386.h to make it possible to reuse the data structure
in other files.
5:
Add the keyword explicit to the declaration of
dwarf2_loc_directive_seen and dwarf2_loc_mark_labels in
gas/dward2dbg.h. This makes it possible to use the header in C++
without getting multiple definitions errors. They are defined in
dwarf2dbg.c
Thanks,
Martin