[Bug ld/23906] LD Bug : Undocumented exit status 253

2018-12-13 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

--- Comment #23 from Tamar Christina  ---
> Anyway to get it to work within windows, I tried EditBin.exe but it didn’t 
> work. I set the reserve stack to 512Mb.

I suspect the reason that isn't working is that setting the reserve stack just
reserves the virtual memory but doesn't change the committed memory, and so the
OS only has allocated still the original amount.

On windows when the stack is allocated you're not allowed to do it more than a
pagesize at a time. Normally applications emit a  __chkstk_ms call for this but
I can't find any such calls in the ld binary.  Ofcourse it is likely the case
that I can't find it because the binaries have been fully stripped..

You could try using editbin but also specifying the commit size. This will only
work if you actually have enough physical memory to back the requested size.
But I believe it should work then too.

> How did you get ld. from GCC9 to work for this target?

The LD was actually the same, it's the compiler that generated less symbols.
But it's not a clean migration as GCC9 no longer allows SP to be clobbered via
inline assembly. So I had to comment out some parts of the code.

A bug needs to be raised against libiberty in GCC for a proper fix.

-- 
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 ld/23906] LD Bug : Undocumented exit status 253

2018-12-13 Thread davidledger at live dot com.au
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

--- Comment #24 from David Ledger  ---
Should I raise the bug with them or does your team do that?




David Ledger - Electronics Design Engineer
 Skype: david.j.ledger









From: tnfchris at sourceware dot org 
Sent: Thursday, December 13, 2018 9:17:10 PM
To: davidled...@live.com.au
Subject: [Bug ld/23906] LD Bug : Undocumented exit status 253

https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceware.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D23906&data=02%7C01%7C%7Cc4d42d5362ab4c12938108d660e42791%7C84df9e7fe9f640afb435%7C1%7C0%7C636802930366926937&sdata=xPnBO8%2F%2F44Pa0dnjLrE2mr4XwFPeHw44Va8wIe1mwrE%3D&reserved=0

--- Comment #23 from Tamar Christina  ---
> Anyway to get it to work within windows, I tried EditBin.exe but it didn’t 
> work. I set the reserve stack to 512Mb.

I suspect the reason that isn't working is that setting the reserve stack just
reserves the virtual memory but doesn't change the committed memory, and so the
OS only has allocated still the original amount.

On windows when the stack is allocated you're not allowed to do it more than a
pagesize at a time. Normally applications emit a  __chkstk_ms call for this but
I can't find any such calls in the ld binary.  Ofcourse it is likely the case
that I can't find it because the binaries have been fully stripped..

You could try using editbin but also specifying the commit size. This will only
work if you actually have enough physical memory to back the requested size.
But I believe it should work then too.

> How did you get ld. from GCC9 to work for this target?

The LD was actually the same, it's the compiler that generated less symbols.
But it's not a clean migration as GCC9 no longer allows SP to be clobbered via
inline assembly. So I had to comment out some parts of the code.

A bug needs to be raised against libiberty in GCC for a proper fix.

--
You are receiving this mail because:
You reported the bug.

-- 
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 ld/23906] LD Bug : Undocumented exit status 253

2018-12-13 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

--- Comment #25 from Tamar Christina  ---
I've reported it upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88480

and will close this one since there's not much we can do in the linker to
mitigate this unfortunately.

-- 
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 ld/23906] LD Bug : Undocumented exit status 253

2018-12-13 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

Tamar Christina  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
URL||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=88480
 Resolution|--- |MOVED

--- Comment #26 from Tamar Christina  ---
Moved to GCC bugzilla, once libiberty is fixed binutils needs to be synced.

-- 
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 ld/23980] New: powerpc64 ld segfault when linking libc on FreeBSD

2018-12-13 Thread alfredo.junior at eldorado dot org.br
https://sourceware.org/bugzilla/show_bug.cgi?id=23980

Bug ID: 23980
   Summary: powerpc64 ld segfault when linking libc on FreeBSD
   Product: binutils
   Version: 2.32 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: alfredo.junior at eldorado dot org.br
  Target Milestone: ---

ld (BFD) crash with Segmentation Fault when cross compiling FreeBSD libc on
PowerPC64. The stack trace is:

Core was generated by `/usr/local/ld/usr/local/bin/ld
--sysroot=/usr/obj/usr/src/powerpc.powerpc64/tmp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00bf4fe7 in _bfd_elf_link_hash_hide_symbol (info=0x119d208
, h=0x, force_local=1) at elflink.c:7522
7522  if (h->type != STT_GNU_IFUNC)
(gdb) bt
#0  0x00bf4fe7 in _bfd_elf_link_hash_hide_symbol (info=0x119d208
, h=0x, force_local=1) at elflink.c:7522
#1  0x00d5a1f8 in ppc64_elf_hide_symbol (info=0x119d208 ,
h=0x804bd64e0, force_local=1) at elf64-ppc.c:6243
#2  0x00bece39 in elf_link_add_object_symbols (abfd=0x8047d7a80,
info=0x119d208 ) at elflink.c:5020
#3  0x00be9b21 in bfd_elf_link_add_symbols (abfd=0x8047d7a80,
info=0x119d208 ) at elflink.c:5741
#4  0x00620145 in load_symbols (entry=0x801c0c990,
place=0x7fff6270) at ldlang.c:3079
#5  0x00624584 in open_input_bfds (s=0x801c0c990, mode=OPEN_BFD_NORMAL)
at ldlang.c:3528
#6  0x006236dc in lang_process () at ldlang.c:7382
#7  0x00630879 in main (argc=1301, argv=0x7fff6518) at
./ldmain.c:440

On stack frame #1 (elf64-ppc.c:6243), second parameter &fh->elf seems to be
invalid/unset (-1)


(gdb) frame 1
#1  0x00d5a1f8 in ppc64_elf_hide_symbol (info=0x119d208 ,
h=0x804bd64e0, force_local=1) at elf64-ppc.c:6243
6243_bfd_elf_link_hash_hide_symbol (info, &fh->elf, force_local);
(gdb) p/x &fh
$2 = 0x7fff5b48
(gdb) p/x &fh->elf
$3 = 0x



(gdb) p *(struct ppc_link_hash_entry *)&fh
$12 = {elf = {root = {root = {next = 0x, string = 0x804bd64e0
"", hash = 4325052448}, type = 224, non_ir_ref_regular = 0, non_ir_ref_dynamic
= 0, linker_def = 1, 
  ldscript_def = 0, rel_from_abs = 0, u = {undef = {next = 0x119d208
, abfd = 0x7fff6180}, def = {next = 0x119d208 ,
section = 0x7fff6180, 
  value = 12504633}, i = {next = 0x119d208 , link =
0x7fff6180, warning = 0xbece39 
"\307\205\250\374\377\377"}, c = {
  next = 0x119d208 , p = 0x7fff6180, size = 12504633}}},
indx = 0, dynindx = 140733193388032, got = {refcount = 140733193388032, offset
= 140733193388032, 
  glist = 0x7fff, plist = 0x7fff}, plt = {refcount =
34439765800, offset = 34439765800, glist = 0x804c51f28, plist = 0x804c51f28},
size = 140737488313968, type = 184, 
other = 94, target_internal = 255, ref_regular = 1, def_regular = 1,
ref_dynamic = 1, def_dynamic = 1, ref_regular_nonweak = 1, dynamic_adjusted =
1, needs_copy = 1, needs_plt = 1, 
non_elf = 1, versioned = versioned_hidden, forced_local = 1, dynamic = 1,
mark = 1, non_got_ref = 1, dynamic_def = 1, ref_dynamic_nonweak = 1,
pointer_equality_needed = 1, 
unique_global = 1, protected_def = 1, start_stop = 1, is_weakalias = 1,
dynstr_index = 140737488314052, u = {alias = 0x7fff5ec8, elf_hash_value =
140737488314056}, verinfo = {
  verdef = 0x7fff5e9c, vertree = 0x7fff5e9c}, u2 =
{start_stop_section = 0x80128dd7f, vtable = 0x80128dd7f}}, u = {stub_cache =
0x801606228, next_dot_sym = 0x801606228}, 
  dyn_relocs = 0x87, oh = 0x7000, is_func = 0, is_func_descriptor = 0, fake =
0, adjust_done = 0, save_res = 0, non_zero_localentry = 0, tls_mask = 0 '\000'}

-- 
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 ld/23980] powerpc64 ld segfault when linking libc on FreeBSD

2018-12-13 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23980

Alan Modra  changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #1 from Alan Modra  ---
> #1  0x00d5a1f8 in ppc64_elf_hide_symbol (info=0x119d208 ,
> h=0x804bd64e0, force_local=1) at elf64-ppc.c:6243

"p *(struct ppc_link_hash_entry *) h" might be useful here, if you can recreate
the problem.

> #2  0x00bece39 in elf_link_add_object_symbols (abfd=0x8047d7a80,
> info=0x119d208 ) at elflink.c:5020

Also, "p *abfd" here.  And "p abfd->filename" then (outside of gdb) report the
output of "file" for this file.  There is some possibility you might be
attempting to link in a non-ppc64 file somehow.

Another useful debug exercise would be to use "watch" on the h->oh field of the
symbol involved here to see where it is being set to -1.

-- 
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 ld/23906] LD Bug : Undocumented exit status 253

2018-12-13 Thread davidledger at live dot com.au
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

--- Comment #27 from David Ledger  ---
I’ve tried ulimit -s unlimited and it still doesn’t work.
Did you do anything other than that that might have caused it to work?



[cid:image001.png@01D448F4.339F3940]


David Ledger - Electronics Design Engineer
www.eevblog.com

 Skype: david.j.ledger







From: tnfchris at sourceware dot org 
Sent: Thursday, December 13, 2018 9:53:31 PM
To: davidled...@live.com.au
Subject: [Bug ld/23906] LD Bug : Undocumented exit status 253

https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceware.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D23906&data=02%7C01%7C%7C0db61d09e5254258ab5608d660e93ae9%7C84df9e7fe9f640afb435%7C1%7C0%7C636802952159249682&sdata=5fIzSF6RK6UkpqRH1wFqe2ADTYBq61jmEvKDVirVBoI%3D&reserved=0

Tamar Christina  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
URL|   
|https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fbugzill&data=02%7C01%7C%7C0db61d09e5254258ab5608d660e93ae9%7C84df9e7fe9f640afb435%7C1%7C0%7C636802952159249682&sdata=1k3%2B1a8os0JApLyE9fvJoeMDMxekvTaeD1p3LsSq1uE%3D&reserved=0
   ||a/show_bug.cgi?id=88480
 Resolution|--- |MOVED

--- Comment #26 from Tamar Christina  ---
Moved to GCC bugzilla, once libiberty is fixed binutils needs to be synced.

--
You are receiving this mail because:
You reported the bug.

-- 
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