This is the mail archive of the 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]
Other format: [Raw text]

Re: Ping: [PATCH] gas: fix bogus error on .org involving expression

>>> On 17.03.16 at 00:46, <> wrote:
> On Wed, Mar 16, 2016 at 10:40:15AM -0600, Jan Beulich wrote:
>> Ping???
>> >>> On 02.03.16 at 12:29, <> wrote:
>> > gas/
>> > 2016-03-02  Jan Beulich  <>
>> > 
>> > 	* expr.c (expr): Set retval to expr_section for expressions
>> > 	involving symbols, which cannot be resolved right away.
> OK.
>> > gas/testsuite/
>> > 2016-03-02  Jan Beulich  <>
>> > 
>> > 	* expr-org.s, New.
>> > 	* gas.exp: Run new test.
> Have you run the new test over a good sample of binutils targets?
> I suspect that the new test won't work on some, tic4x and tic54x, for
> example.  OK with changes to exclude such targets.

Indeed there were quite a few. Namely, due to the use
of .pushsection and .popsection all non-ELF targets need to be
excluded. mep-*-elf was the only other one needing exclusion,
since the complex relocation support it enables appears to result
in expressions not getting evaluated in time for .org to get its
operand fully resolved. To be honest, I'm not really bothered
enough to dig into finding (and fixing) the exact reason for this.

Beyond those, however, this also revealed a few other failures:

1) i586-aout had several regressions due to the unimplemented
segment checks in i386_finalize_immediate() and
i386_finalize_displacement() not accounting for expr_section.
This will therefore require an update to the patch itself, not just
the testsuite (which I think is warranted even if the test now is
being limited to ELF targets).

2) Along the same lines HPPA's "Bad segment in expression."
warning generation logic didn't account for expr_section.

3) xtensa-elf setting TC_FINALIZE_SYMS_BEFORE_SIZE_SEG to 0
causes the "invalid operands (.text.unlikely and .text.startup
sections) for `-'" to not appear for elf/bad-group.s. Prior to the
change this was detected as "operation combines symbols in
different segments" from expr(), but the code change results in
this error getting eliminated. It's not clear to me how to make
sure the "finalize_syms" dependent "invalid operands" error from
resolve_symbol_value() gets properly raised for such targets
(nds32 appears to be the only other one, which my set of tested
targets didn't include).

4) MMIX'es pr12815-* tests both fail (they no longer produce the
expected or any other error). Since I have no idea what exactly
those tests test, I also have no idea how to deal with this.

I'm attaching the patch taking care of everything except 3) and
4); please advise what to do about those two remaining issues
(I'm also Cc-ing the respective target code maintainers for that


Attachment: binutils-master-master-org-expression.patch
Description: Text document

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