yasm-user?
Peter Johnson
peter at tortall.net
Fri Apr 11 02:45:35 PDT 2008
On Thu, 10 Apr 2008, Dave Lee wrote:
> I'm trying to compile x264 on my x86 mac.
What object format are you trying to target? I suspect macho32?
> The error I am getting is: "effective address too complex". Is there a
> way to print out what made the expression pass into "too complex"
> territory?
Unfortunately, no (this is probably an area worth improving, but it's
non-trivial). But we can make some further progress in isolating the
issue, keep reading...
> The actual lines referred to by yasm are macro calls, eg:
What may help is running the code through just the preprocessor to
text-expand out the macros and show the actual text being assembled. This
can be done by using the "-e" command line option. You can then strip out
the "%line"s (using grep) and assemble the result to get an excellent idea
of exactly what line is being assembled and what it looks like to the
assembler.
> In the end, my question is, how can I find out why the effective
> address is too complex, and how can I simplify it?
"effective address is too complex" basically boils down yasm not being
able to map the effective address (the thing within the []) into an
internal simplified format that roughly maps to what's allowable in the
superset of all available object formats.
The internal format consists of:
- An absolute expression; this can contain differences between symbols
(e.g. label1-label2) but not standalone labels.
- A relative portion. This is where the standalone label goes. There
may only be one standalone label (this is often a probable cause).
- A "with respect to" (wrt) portion. Unless you see "WRT" in the
expression, this isn't being used.
- Various flags that allow more complex manipulation of a standalone
label (so you're not just limited to expr+label): taking the segment of
the label, shifting it right, allowing it to be relocated relative to the
current assembly position, etc.
Generally the cause of the "too complex" error is that the expression
contains either too many standalone labels (e.g. expr+label1+label2), or
manipulations of a label that can't be mapped into the flags portion of
the internal format.
So, the next step I think is to run the code through the preproc with -e,
and post the line that's giving the error. Also important to know is both
the labels the expression references and what sections they are in (yasm
can simplify more effectively if the labels are in the same section).
Thanks,
Peter
More information about the yasm-devel
mailing list