[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2024-02-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #15 from Alan Modra  ---
Fixed then.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2021-04-20 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #14 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c5df7e442e6cdc9303b7373842370d6ee8f67ea5

commit c5df7e442e6cdc9303b7373842370d6ee8f67ea5
Author: Cl?ment Chigot 
Date:   Tue Apr 20 14:40:43 2021 +0100

Rework the R_NEG support on both gas and ld for the PowerPC AIX targets, in
order to manage C++ exceptions built with GCC.

bfd PR binutils/21700
* reloc.c (BFD_RELOC_PPC_NEG): New relocation.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Add
BFD_RELOC_PPC_NEG handler.
(xcoff_reloc_type_neg): Correctly substract addend.
* coff64-rs6000.c (xcoff64_howto_table): Add R_NEG_32
howto.
(xcoff64_rtype2howto): Add handler for R_NEG_32.
(xcoff64_reloc_type_lookup): Add BFD_RELOC_PPC_NEG handler.
* xcofflink.c (xcoff_need_ldrel_p): Check output section
for R_POS-like relocations. New argument added.
(xcoff_mark): Adapt to new xcoff_need_ldrel_p argument.
(xcoff_link_input_bfd): Likewise.

gas * config/tc-ppc.c (ppc_get_csect_to_adjust): New function.
(ppc_fix_adjustable): Manage fx_subsy part.
(tc_gen_reloc): Create second relocation when both
fx_addsy and fx_subsy are provided.
* config/tc-ppc.h (RELOC_EXPANSION_POSSIBLE): New define.
(MAX_RELOC_EXPANSION): Likewise.
(TC_FORCE_RELOCATION_SUB_SAME): Likewise
(UNDEFINED_DIFFERENCE_OK): Likewise
* testsuite/gas/all/gas.exp: Skip difference between two
undefined symbols test.

ld  * testsuite/ld-powerpc/aix52.exp: Add new test.
* testsuite/ld-powerpc/aix-neg-reloc-32.d: New test.
* testsuite/ld-powerpc/aix-neg-reloc-64.d: New test.
* testsuite/ld-powerpc/aix-neg-reloc.ex: New test.
* testsuite/ld-powerpc/aix-neg-reloc.s: New test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2021-04-15 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #13 from James Reynolds  ---
(In reply to Clément Chigot from comment #12)
> Hi all, 
> 
> I'm planning to fix this issue in the following days, as part of my work on
> binutils improvements on AIX.
> 
> James Reynolds, do you mind if I base my work upon your patches ? I didn't
> find your mail thus I must ask it here, sorry for that.

Hi Clément,

Absolutely. I had a conversation later with someone at IBM and it seems there
are a lot of linker changes required after this set of patches, I did get a
little way forwards on this but their method of directly patching in functions
(e.g. memset) eluded me. I'm no longer working in the area but my latest work
is here on github: https://github.com/JamesReynolds/binutils-gdb.

If you need help over email I'm at jum.reyno...@gmail.com.

Thanks,
James

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2021-04-14 Thread clement.chigot at atos dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

Clément Chigot  changed:

   What|Removed |Added

 CC||clement.chigot at atos dot net

--- Comment #12 from Clément Chigot  ---
Hi all, 

I'm planning to fix this issue in the following days, as part of my work on
binutils improvements on AIX. 

James Reynolds, do you mind if I base my work upon your patches ? I didn't find
your mail thus I must ask it here, sorry for that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2018-12-04 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #11 from James Reynolds  ---
(In reply to Rizwan Macknojia from comment #10)
> Any plans to submit the changes to upstream. Is your fix only works for
> 32bit or it also address issues with 64bit

I don't at the moment, I *think* I need a sponsor as I'm outside the project.
However, I would quite like to and could pick this up again.

I'll have another try at finding the procedure documentation and fire off some
emails.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2018-12-04 Thread rizwanmacknojia at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #10 from Rizwan Macknojia  ---
Any plans to submit the changes to upstream. Is your fix only works for 32bit
or it also address issues with 64bit

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2018-03-21 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #9 from James Reynolds  ---
(In reply to James Reynolds from comment #8)
> (In reply to James Reynolds from comment #7)
> > (In reply to Rizwan Macknojia from comment #6)
> > > Any update on this issue. I am creating a AIX cross-compiler on linux and
> > > hitting the similar issue.
> > > 
> > > Using 
> > > binutils 2.29
> > > gcc 7.2
> > > target powerpc-ibm-aix7.2.0.0
> > 
> > None I'm afraid. I've been dragged away to other projects (and have a new
> > baby, so no personal time either!) but we are looking at much more AIX
> > development in 2018. I've had 2 personal emails about this too - so there is
> > definite interest.
> > 
> > After this though there are a few linker issues too and I still need to get
> > the exception mechanism working. I'll update in January, and possibly make
> > an AIX fork to be merged back when this is operational.
> 
> I've now fixed the RBR_26 problem - so the relocations now match IBM's
> relocations exactly. This is in a fork here:
> https://github.com/JamesReynolds/binutils-gdb
> 
> Unfortunately this was not the cause of exceptions not being caught. I think
> something is mis-calculated in .gcc_except_table. However, I think this bug
> could be closed if this change could be merged. I'll start the procedure for
> that today.

Further to this I've now cured the exception problem, the subtraction
calculation was wrong so the FDE fields were not correctly populated. Fixed in
fork. Using a g++ compiled with native tools the following now succeeds:

$ powerpc-ibm-aix6.1-as -mpwr4 exception.s -o exceptions.o
$ g++ exceptions.o -o exceptions
$ ./exceptions
> "Caught"

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2018-03-19 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #8 from James Reynolds  ---
(In reply to James Reynolds from comment #7)
> (In reply to Rizwan Macknojia from comment #6)
> > Any update on this issue. I am creating a AIX cross-compiler on linux and
> > hitting the similar issue.
> > 
> > Using 
> > binutils 2.29
> > gcc 7.2
> > target powerpc-ibm-aix7.2.0.0
> 
> None I'm afraid. I've been dragged away to other projects (and have a new
> baby, so no personal time either!) but we are looking at much more AIX
> development in 2018. I've had 2 personal emails about this too - so there is
> definite interest.
> 
> After this though there are a few linker issues too and I still need to get
> the exception mechanism working. I'll update in January, and possibly make
> an AIX fork to be merged back when this is operational.

I've now fixed the RBR_26 problem - so the relocations now match IBM's
relocations exactly. This is in a fork here:
https://github.com/JamesReynolds/binutils-gdb

Unfortunately this was not the cause of exceptions not being caught. I think
something is mis-calculated in .gcc_except_table. However, I think this bug
could be closed if this change could be merged. I'll start the procedure for
that today.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-12-27 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #7 from James Reynolds  ---
(In reply to Rizwan Macknojia from comment #6)
> Any update on this issue. I am creating a AIX cross-compiler on linux and
> hitting the similar issue.
> 
> Using 
> binutils 2.29
> gcc 7.2
> target powerpc-ibm-aix7.2.0.0

None I'm afraid. I've been dragged away to other projects (and have a new baby,
so no personal time either!) but we are looking at much more AIX development in
2018. I've had 2 personal emails about this too - so there is definite
interest.

After this though there are a few linker issues too and I still need to get the
exception mechanism working. I'll update in January, and possibly make an AIX
fork to be merged back when this is operational.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-12-21 Thread rizwanmacknojia at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

Rizwan Macknojia  changed:

   What|Removed |Added

 CC||rizwanmacknojia at gmail dot 
com

--- Comment #6 from Rizwan Macknojia  ---
Any update on this issue. I am creating a AIX cross-compiler on linux and
hitting the similar issue.

Using 
binutils 2.29
gcc 7.2
target powerpc-ibm-aix7.2.0.0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-07-07 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #5 from James Reynolds  ---
Created attachment 10252
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10252&action=edit
Better patch and example

I think this patch fixes the issue and another issue - but unfortunately I
think this now gets blocked by a linker issue, which I can raise separately.

I've added the relocations to use R_NEG after R_POS[_64] and this seems to
match what the IBM linker is doing. I've also adjusted ppc_fix_adjustable so
that this code:

.vbyte  4,LFB..0-$

generates an R_POS / R_NEG as well as this is what the IBM assembler does.

For a small test problem (in archive) this generates the same relocations as
IBM modulo positions in the TOC (I think).

Unfortunately... switching to use R_RBR_26 instead of R_BR causes an illegal
instruction. Just using R_BR generates a working program but the exception
isn't correctly caught. (This is using the IBM linker)

Should I now get this patch landed, close this bug and create another once I've
found the root cause of the illegal instruction / R_BR issues?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-07-05 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

--- Comment #4 from James Reynolds  ---
(In reply to Alan Modra from comment #3)
> OK, so the AIX assembler emits two relocations for the expression,
> R_POS_64 against _compatibility.rw_, and R_NEG against __gcc_unwind_dbase. 
> The GNU assembler would need to do the same.  grep for
> RELOC_EXPANSION_POSSIBLE to get an idea of how to do this.
> 
OK, I'll give this a bash. I don't think I have the relevant bugzilla
permissions to assign this to myself though.

> Be warned that the GNU XCOFF support has not been maintained for a long
> time, and wasn't that good to start with.

Yes... I'm hoping that by fixing some of the issues I can get it good enough
for my purposes (smoke tests in CI) which I think a couple of others require as
well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-07-04 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-05
 Ever confirmed|0   |1

--- Comment #3 from Alan Modra  ---
OK, so the AIX assembler emits two relocations for the expression,
R_POS_64 against _compatibility.rw_, and R_NEG against __gcc_unwind_dbase.  The
GNU assembler would need to do the same.  grep for RELOC_EXPANSION_POSSIBLE to
get an idea of how to do this.

Be warned that the GNU XCOFF support has not been maintained for a long time,
and wasn't that good to start with.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-07-04 Thread james.reynolds at cristie dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

James Reynolds  changed:

   What|Removed |Added

 CC||james.reynolds at cristie dot 
com

--- Comment #2 from James Reynolds  ---
Created attachment 10241
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10241&action=edit
Compiled assembly and CC files

(In reply to Alan Modra from comment #1)
> Please attach the assembly file giving this error, and the resuling object
> file produced by IBM as.  
> 
> The patch you propose is just hiding a problem, perhaps with gcc.  Most
> relocation formats, including xcoff I believe, don't support relocations
> with two or more symbols.

Yes, you are indeed correct, I get an error later with:

  ld-new: .libs/compatibility.o: loader reloc in read-only section .text

The attached file contains the *.cc file that comes from the pre-processing
stage, the assembler output of compiling that (on an AIX box) and the result of
compiling that using IBM as and using gnu as and my misguided patch.

The errors from this file are:
compatibility.s: Assembler messages:
compatibility.s:959: Error: can't resolve `_compatibility.rw_[RW]' {.data
section} - `__gcc_unwind_dbase' {*UND* section}
compatibility.s:1330: Error: can't resolve `_compatibility.rw_[RW]' {.data
section} - `__gcc_unwind_dbase' {*UND* section}
compatibility.s:1389: Error: can't resolve `_compatibility.rw_[RW]' {.data
section} - `__gcc_unwind_dbase' {*UND* section}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/21700] powerpc-ibm-aix6.1.0.0 fails with unresolved symbols

2017-07-03 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21700

Alan Modra  changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #1 from Alan Modra  ---
Please attach the assembly file giving this error, and the resuling object file
produced by IBM as.  

The patch you propose is just hiding a problem, perhaps with gcc.  Most
relocation formats, including xcoff I believe, don't support relocations with
two or more symbols.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils