Age | Commit message (Collapse) | Author | Files | Lines |
|
Currently, if we try to define an already defined section and specify
section flags, NASM will output "warning: section attributes ignored
on redeclaration of section %SECTIONNAME%".
The patch modifies this behaviour:
1. If the previous section definition differs only in alignment flags,
no warning is generated
2. If the new definition implies larger alignment, it overrides the
previous section alignment
3. If the new definition specifies any section alignment, the content of
the section will be aligned on the new boundary (i.e. the effect is the
same as if there was ALIGN macro)
Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
http://bugzilla.nasm.us/show_bug.cgi?id=3392233
Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
The C standard guarantees that strncpy pads
the string with zeros if source string is smaller
than destination buffer.
Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Fix warnings like this:
output/outelf32.c:2120:33: warning: equality comparison with extraneous
parentheses [-Wparentheses-equality]
if ((match->section == index)) {
~~~~~~~~~~~~~~~^~~~~~~~
output/outelf32.c:2120:33: note: remove extraneous parentheses around the
comparison to silence this warning
if ((match->section == index)) {
~ ^ ~
output/outelf32.c:2120:33: note: use '=' to turn this equality comparison into
an assignment
if ((match->section == index)) {
^~
=
1 warning generated.
Signed-off-by: Andrew Nayenko <resver@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
One day the elf output routines would be abstracted
enough to be merged in one file. This patch simply
removes some differences from elf32/64 code.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
This patch changes get_closest_section_symbol_by_offset
logic to lookup only the closest symbols which are at
or before the supplied offset.
Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Add an x32 ELF (32-bit code with the CPU in 64-bit mode) backend.
|
|
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>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
Conflicts:
nasm.h
version
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
__OUTPUT_FORMAT__ must consist of shortname of output format
or its alias, otherwise userspace ABI gets broken.
For example source code still can refer to __OUTPUT_FORMAT__=elf,
instead of __OUTPUT_FORMAT__=elf32.
BR3246990
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>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Instead of opencoded zero assignments better to use nasm_zalloc
and set fields which are supposed to be non-nil. This simplifies
code and makes it more readable.
Also note the field 'ifollows' renamed to 'prev' as it should
be from the very beginning in terms of lists.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
The backport of
4db724fdd76e3a6cd0f5124ef86de976c495d666
359b63f8976375f071edc33092daea57efa768fb
01102ee8e6a967830bcd6f0134efe8976f473121
2672af737954fb17ec0ebf17e787219a504c4400
so coff output target to be able to handle
massive relocations.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
It was a nit in first place.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
In case if relocations number exceed 16bit values
we have to hande such case by a special way, as described
in COFF specification.
"IMAGE_SCN_LNK_NRELOC_OVFL indicates that the count of
relocations for the section exceeds the 16 bits that are
reserved for it in the section header. If the bit is set
and the NumberOfRelocations field in the section header
is 0xffff, the actual relocation count is stored in the
32-bit VirtualAddress field of the first relocation. It
is an error if IMAGE_SCN_LNK_NRELOC_OVFL is set and
there are fewer than 0xffff relocations in the section."
[ BR3092924 ]
Reported-by: Robert Yates
Investigated-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Actually it's temporary action. We have to support more
relocations then that but it requires some more code rework.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
We will need it to analyze if section relocations
are overflowed.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
We could have accessed malloc'ed data on external symbols
in obj and ieee output formats. Fix it by using nasm_zalloc.
Reported-by: Jiri Malak
Patch-by: Jiri Malak
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
We could have accessed malloc'ed data on external symbols
in obj and ieee output formats. Fix it by using nasm_zalloc.
Reported-by: Jiri Malak
Patch-by: Jiri Malak
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Get rid of code duplication
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
No need for 'q' variable.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
In commit 55ae12052cd1 we occasionally broke byte ordering. Fix it.
Note that current stable version 2.08.01 is not affected by this bug.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Apparently some people still care about compiling native on MS-DOS,
and we don't have a significant number of files which need adjustment.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
OpenWatcom, in particular, doesn't handle switch() statements with
64-bit expressions, sigh.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
OpenWatcom, in particular, doesn't handle switch() statements with
64-bit expressions, sigh.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
ARRAY_SIZE is a well known name pointing out that
we're dealing with array in macro argument.
Also to be on a safe side prefix_name helper should
check the index been in bounds more precisely.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
The possible sizes we can encounter are 1, 2, 4, 8... make sure we get
a proper error message.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Error out on any relocations not supported by the backend.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Support 8-bit relocations (OUT_ADDRESS and OUT_REL1ADR) in ELF.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Add OUT_REL1ADR (one-byte relative address) and support for
OUT_ADDRESs with size == 1. Add support for it in
outbin and outdbg. *It still needs to be added to other backends*,
both the OUT_REL*ADR and OUT_ADDRESS codepaths need to be handled.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
macho_sectalign was occasionally misprinted
with macho_setcalign, fix it. No change on functionality.
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>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
There is no need for it anymore.
Reported-by: "H. Peter Anvin" <hpa@linux.intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|