This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Changes to gas/write.c and others break the ia32 assembler


On Aug 23, 2000, "H . J . Lu" <hjl@lucon.org> wrote:

>> How did it work without it, in write.c?

> Because write.c includes config/obj-elf.h, which defines OBJ_ELF,
> after config/tc-i386.h. OBJ_MAYBE_ELF may be defined in config.h,
> which is a generated file.

I see.  Thanks, I'll fix that.

> Call me dumb. I can't see how turning 
[...]
> can have the same effect if foo (x) doesn't return a constant.

It may not appear to have the same effect, but it should have the same
effect.  tc_fix_adjustable() returns true when the assembler is
allowed to adjust a reference to symbol into a reference to a section
plus an offset.  If it returns false, it is either because the
assembler doesn't have enough information to compute the offset (for
example, the symbol is external) or it should not make the adjustment
because the linker (static or dynamic) may bind the reference to a
difference symbol.

So, when it returns false, it means the assembler shouldn't mess up
with that reference.  I.e., it shouldn't apply the relocation.

So, using tc_fix_adjustable() instead of 0 ends up being a
sanity-check.  It shouldn't modify the behavior.  It currently does
because I had missed OBJ_MAYBE_ELF.  I'm checking whether it fixes the
problem for x86 and, if it does, I'll apply a similar fix for all
affected targets.

Thanks for helping me figure it out.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]