| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Due to a misprint in commit
9b66d8e4c3030474a75e598f699eccc118a3d651
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
| |
No need for SEG_ALIGN_1 since we have switched
to ALIGN helper.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
| |
Instead of implicit declaration of global symbols obtained
by STB_GLOBAL << 4, and local symbols by STB_LOCAL << 4
use ELF32_ST_MKBIND helpers.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
| |
The profit of ELFXX_ST_MKBIND helper is that we
will use it for SYM_GLOBAL explicitly pointing
out from where this magic 0x10 came from.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
| |
Also made Makefile.in to handle dependency.
There are some makefiles in Mkfiles\ should
be fixed as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Some tab\space convertions together with
trivial style nitfix.
No change on binary level.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Commit 2ddcd03900d134772e98acf8cab17a12cc0c3f2a
did bind symbols (in case of omitted SECTION directive)
to .text section but break COMMON binding.
Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case if SECTION directive is omitted but the real
code exist we form .text section by default and put compiled
code here. In turn labels are not handled in a same manner.
So lets bind them to text section by default as well.
[ BR: 2835192 ]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
| |
The old RDF format has been unsupported for long time now. Remove it
from the tree.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
| |
OF_NO_RDF2 should turn off OF_RDF2, not OF_RDF
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Somehow outmacho32.c escaped the global change of error variables to
hard-coded nasm_error().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Due to previous commit an indent by tab (occasionally) brought in.
Fix it as well. No change on binary level.
We're not that far from NASM release so it's a bit unpleasant
manner to push in such trivial change. But since it's the previous
commit dependent -- I dare to push it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
| |
If an export identifier is greater then 241 symbols
we do fail due to buffer overflow. Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
| |
Make a small step forward elf32/64 unification procedure.
Mostly style fixes. Nothing serious.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
| |
And make dwarf64 version to be more familiar to
32bit version (preparation work for merge).
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
| |
nasm_free is failsafe against NULL passed
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Merge elfcommon.h, elf32.h, elf64.h into
single elf.h -- we do support both elf32
and elf64 anyway. Let put them into common
place.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From Frank Kotler:
| ...
| > - stdscan_bufptr = saveme; /* bugfix? fbk 8/10/00 */
| > + stdscan_set(saveme); /* bugfix? fbk 8/10/00 */
|
| While you're at it, you could remove my comment(s - it seems to have
| reproduced). It *is* a bugfix (apparently). "saveme" might have a better
| name, too...
So get rid of the comments.
Reported-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Instead of manipulating stdscan buffer pointer directly
we switch to a routine interface.
This allow us to unify stdscan access: ie caller should
"talk" to stdscan via stdscan_get/set routines.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This represent "end of compilation unit" token.
Since gcc does (almost) the same lets be on the
same side.
Though to be precise gcc puts offset which points
to the first byte right after the last instruction
issued but in fact string index is analyzed only
so we may safely write zero here (without relocation
as well).
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
| |
No change on binary level
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) nasm_free is safe against NULL passed so call
it without test
2) dwarf32_output: check for debug_immcall early
and get out of procedure if success. This allow
us to move code blocks left removing indents.
3) dwarf32_findfile and dwarf32_findsect: no need
for 'else' when 'if' target is plain return.
Move code blocks left removing indents.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
| |
Together with a small style nitpicking.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
| |
LLVM's Clang warns about this. outieee.c had a real problem.
|
|
|
|
|
| |
Added a format attribute to nasm_error (only for GCC) and
used the resulting warnings to fix some format strings.
|
|
|
|
|
|
|
|
|
| |
There is a hope we'll be supporting dwarf in full form in future. So
I've encoded the standard constants (though binutils uses some
additional codes).
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
This is the null implementation of the function debug_directive. For
some reason it ended up getting mangled as "null_debug_routine".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
| |
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Note that we use list_for_each(var,var) sometime
which actually brings in at least one redundant
assignment in case of NULL being passed but save
us a few lines of code.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The construct:
if (i == nsects)
directive_sec =
sects[coff_make_section
(EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS)];
... where coff_make_section() can change the global variable "sects"
is undefined C, since there is no sequence point involved in the []
operator, and it is therefore fully permitted for the C compiler to
read the sects variable first. Change this construct into two
statements to enforce defined behavior; this also ends up with the
code slightly simpler.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We never set ofmt and errfunc to anything but the global values.
Dropping them from the label definition function command line
simplifies the code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove a bunch of function pointers in the output stage; they are
never changed and don't add any value. Also make "ofile" a global
variable and let the backend use it directly.
All we ever did with these variables were stashing it in locals and
using them as-is anyway for no benefit.
Also change the global error function, nasm_error() into a true
function which invokes a function pointer internally. That lets us
use direct calls to it.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
ofmt is a static in nasm.c (why?), not a global...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| | |
Fix error message in outcoff to say COFF, not binary format...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
|
| |
| |
| |
| |
| |
| | |
Missed fclose() in outobj when converting system to global fclose().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|\ \
| |/
| |
| |
| | |
Conflicts:
.gitignore
|
| |
| |
| |
| |
| |
| | |
Add debug support for TY_YWORD (256 bits/32 bytes).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| | |
TY_OWORD is 8 * TY_WORD = 16 bytes length
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Hash all directives, even the ones that are backend-specific,
and instead pass the backend an already-parsed directive number.
Furthermore, unify null functions across various backends.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We fopen() the output file in common code but fclose() it in the
backend. This is bad for a variety of reasons:
1. it is generally an awkward interface to change ownership.
2. we should use ferror() to test for write errors, and that is
better done in common code.
3. it requires more code.
4. we still need to fclose() in common code during error handing.
Thus, move the fclose() of the output out of the backends, and add
fflush() so we can test ferror() on output.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|