[Bug gold/18847] Gold: Address of section moves backward when aligned.

2015-08-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18847

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Cary Coutant :

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

commit 7c61d651fd0e42b8f68840a3735ed7e46d4fd083
Author: Cary Coutant 
Date:   Wed Aug 26 00:03:04 2015 -0700

Fix problem where script specified both address and region for a section.

If a script specifies both address and region for an output section
declaration, gold ignores the region specification. This can lead to
bogus "moves backward" errors. This patch fixes gold so that if a
section specifies both address and region, it will place the section
at the specified address in the region, and update the location counter
within the region.

gold/
PR gold/18847
* script-sections.cc (Memory_region::set_address): New method.
(Script_sections::find_memory_region): Add explicit_only parameter.
(Output_section_definition::set_section_addresses): Handle case where
script specifies both address and vma region.
* script-sections.h (Script_sections::find_memory_region): Add
explicit_only parameter.

-- 
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 gold/18847] Gold: Address of section moves backward when aligned.

2015-08-26 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18847

Cary Coutant  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Cary Coutant  ---
Fixed on master. The actual fix was a bit more complicated, as we had to
account for updating the location counter within the specified region and
checking that the specified address is actually contained within the region.

As an aside, the original script would have worked fine with one simple change.
As written,

.data ALIGN(0x1) :

the ALIGN() expression specifies the section start address, which gold took to
override the region specification. By writing this instead:

.data : ALIGN(0x1)

the ALIGN() expression is an alignment property of the output section rather
than a section start address, and gold produces correct output even without the
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 gold/18874] New: src/gold/gc.h:207: performance tweek ?

2015-08-26 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18874

Bug ID: 18874
   Summary: src/gold/gc.h:207: performance tweek ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: minor
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

[src/gold/gc.h:207]: (performance) Passing the result of c_str() to a function
that takes std::string as argument no. 1 is slow and redundant.

Source code is

 if (parameters->options().icf_enabled()
  && is_section_foldable_candidate(src_section_name.c_str()))

but

inline bool
is_section_foldable_candidate(const std::string& section_name)

-- 
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/18842] sparc64-sun-solaris2.9: error: implicit declaration of function ‘asprintf’

2015-08-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18842

--- Comment #5 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=2a7f4fa91ffc8ad3ad195f7ac02a4c97bc96b791

commit 2a7f4fa91ffc8ad3ad195f7ac02a4c97bc96b791
Author: Nick Clifton 
Date:   Wed Aug 26 10:56:26 2015 +0100

Add asprintf to the list of functions whose decls are checked at configure
time.

PR gas/18842
* configure.ac (AS_CHECK_DECLS): Add asprintf.
* configure: Regenerate.
* config.in: Regenerate.

-- 
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/18842] sparc64-sun-solaris2.9: error: implicit declaration of function ‘asprintf’

2015-08-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18842

Nick Clifton  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Nick Clifton  ---
Hi Marcin,

  OK  I have checked the patch in.

Cheers
  Nick

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

--- Comment #5 from Stas Sergeev  ---
(In reply to Cary Coutant from comment #3)
> The bottom line is that I don't have a good idea for how to fix this to
> match the Gnu ld documentation without breaking something.
You had to add an option for enabling the gold-specific
extensions. Maybe its still not too late? Who knows...

> What's difficult about adding the "0x" so that it works with both linkers?
It doesn't. Even adding 0x doesn't help because -Ttext
in gold means something completely different than in bfd.
What works in all cases is only
--section-start=.text=0xaddr

Its not something that can't be done.
But you must be aware that gold being used as a drop-in
replacement for ld.bfd results in a broken builds.
It also appears to me that gold doesn't search /usr/local/lib
by default, so even many autoconf scripts fail.

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread ian at airs dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

--- Comment #6 from Ian Lance Taylor  ---
The difference in -Ttext behaviour between gold and GNU ld is intentional.  The
-Ttext option in GNU ld is nearly meaningless when using ELF.  Gold's -Ttext
option corresponds to GNU ld's -Ttext-segment option.  The difference in
accepted numbers is not.  For some reason nobody ever noticed that ld defaults
to hex and gold defaults to decimal.

Yes, this means that gold is not a drop-in linker replacement for all uses. 
That is true for several reasons.

As far as I can tell GNU ld does not search /usr/local/lib either, unless
configured with a special --with-lib-path option.  In any case, that should be
a different bug report.

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

--- Comment #7 from Stas Sergeev  ---
(In reply to Ian Lance Taylor from comment #6)
> The difference in -Ttext behaviour between gold and GNU ld is intentional. 
> The -Ttext option in GNU ld is nearly meaningless when using ELF.  Gold's
> -Ttext option corresponds to GNU ld's -Ttext-segment option.  The difference
> in accepted numbers is not.  For some reason nobody ever noticed that ld
> defaults to hex and gold defaults to decimal.
This bug was filled in 2012, so obviously it was
noticed also before.
IMHO the intentional differences are good, but you
could add a command-line switch to enable them.
For example it seems --section-start actually accepts
the decimal numbers as hex (without requiring 0x), but
-T requires 0x. So you have inconsistencies.

> Yes, this means that gold is not a drop-in linker replacement for all uses. 
> That is true for several reasons.
Its fine as long as you teach the distributions
about this. :) So far at least fedora provides
gold as an "alternative" to ld.bfd, so that you
only do
alternatives --set ld /usr/bin/ld.gold
https://fedoraproject.org/wiki/Features/GoldLinkerDefault
They say:
"The only user-visible change should be link times improve, particularly for
very large applications."
I think ubuntu does the same.
So people really think it is a drop-in replacement.
Maybe you can implement an option that will make it
fully compatible? Then fedora will be able to perhaps
run it via some wrapper script that will enable that
compatibility mode? No current users will be affected.

> As far as I can tell GNU ld does not search /usr/local/lib either, unless
> configured with a special --with-lib-path option.  In any case, that should
> be a different bug report.
OK, I'll report that to fedora then, thanks.

-- 
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/18581] (ARM): issue with function names with a dash inside

2015-08-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18581

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 2d011dc1696f38580ca08cdccf9cb8147527063a
Author: Alan Modra 
Date:   Wed Aug 26 22:55:41 2015 +0930

Fallout from "Allow symbol and label names to be enclosed in double quotes"

PR gas/18581
* config/tc-mn10200.c (md_assemble ): Move restore_line_pointer
call to where input line used to be restored.
* config/tc-mn10300.c (md_assemble ): Remove redundant input
line restore.
* config/tc-tilepro.c (parse_reg_expression): Add regname var.

-- 
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/18401] MIPS -march=xlp results in inconsistent ISA markers

2015-08-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18401

--- Comment #6 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=c97c330ba8e80776c546e5f562916bf077e358b3

commit c97c330ba8e80776c546e5f562916bf077e358b3
Author: Matthew Fortune 
Date:   Wed Aug 26 14:42:56 2015 +0100

Select MIPS ABi based upon abiflags rather than e_flags.

bfd PR ld/18401
* elfxx-mips.c (bfd_mips_isa_ext_mach): New function: Converts an
ISA value to a bfd machine number.
(bfd_mips_isa_ext): Update the ISA level and revision if
necessary.  Use mips_mach_extends_p to decide if the ISA extension
needs to be set.
(_bfd_mips_elf_merge_private_bfd_data): Allow the ISA extension to
be inferred from the ABI setting.  Set the ISA level from the
maximum of the incoming and outgoing ISA levels.

tests
* ld-mips-elf/mips-elf-flags.exp: Add more ISA conflict tests.

-- 
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/18401] MIPS -march=xlp results in inconsistent ISA markers

2015-08-26 Thread matthew.fortune at imgtec dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18401

--- Comment #7 from Matthew Fortune  ---
(In reply to cvs-com...@gcc.gnu.org from comment #6)
> The master branch has been updated by Nick Clifton :

Thanks Nick. I ran out of steam after trying to get my head around the right
kind of fix.

>   * ld-mips-elf/mips-elf-flags.exp: Add more ISA conflict tests.

I'd forgotten this .exp existed! I'll look through this when I get chance and
see if there are any other cases worth testing.

Matthew

-- 
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/18867] ld reloc sorting causes glibc to crash on alpha

2015-08-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18867

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 0e28778672160ee57d12fcc4f0e631122088fe69
Author: Alan Modra 
Date:   Wed Aug 26 17:32:08 2015 +0930

Use stable sort for ld -r relocs

A number of targets emit multiple relocs at a given r_offset, and
depend on those relocs staying in their original order.

PR 18867
* elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
(cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
(ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
New functions.
(elf_link_adjust_relocs): Use an insertion sort to sort relocs.

-- 
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/18401] MIPS -march=xlp results in inconsistent ISA markers

2015-08-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18401

--- Comment #8 from Nick Clifton  ---
Hi Matthew,

  Thanks for the patch.  I have checked it in with one small change - I used
macros to encode and decode the abi level and revision numbers into a single
value.  That way we can easily change the encoding if, say, we want to add more
revision levels or isa levels.

  As for testing the architecture support,
ld/testsuite/ld-mips-elf/mips-elf-flags.exp already does a lot of this.  I
added a few more tests, but then discovered that it is tied to 32-bit MIPS
variants.  It could be extended to 64-bit versions though, or maybe a new set
of tests, and a test driver, could be added.

Cheers
  Nick

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread vapier at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

Mike Frysinger  changed:

   What|Removed |Added

   See Also||https://bugs.gentoo.org/sho
   ||w_bug.cgi?id=439082

--- Comment #8 from Mike Frysinger  ---
it goes back even further ... this report was created as a result of earlier
reports dating back to at least Oct 2011:
https://savannah.gnu.org/bugs/?34539

-- 
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/18867] ld reloc sorting causes glibc to crash on alpha

2015-08-26 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18867

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Alan Modra  ---
Forgot to add the pr number to commit message, so adding info by hand from
https://sourceware.org/ml/binutils-cvs/2015-08/msg00192.html

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

commit 6fc5bb5718b72250cffb9c09110515971f72e116
Author: Alan Modra 
Date:   Thu Aug 27 10:54:28 2015 +0930

Don't sort ld -r output relocs on alpha

LITERAL/LITUSE relocs must be kept together.

* elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
(elf_backend_sort_relocs_p): Define.

-- 
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/18867] ld reloc sorting causes glibc to crash on alpha

2015-08-26 Thread vapier at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=18867

--- Comment #4 from Mike Frysinger  ---
(In reply to Alan Modra from comment #3)

thanks, i can confirm master is working again now

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread ian at airs dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

--- Comment #9 from Ian Lance Taylor  ---
Not that it matters much, but gold was first released in 2008, so when I say
"nobody noticed" I meant for those first four or so years.

-- 
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 gold/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2015-08-26 Thread vapier at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

--- Comment #10 from Mike Frysinger  ---
(In reply to Ian Lance Taylor from comment #9)

sure, it was first released in binutils-2.19 which was ~Oct 2008 (3 years
before the grub report), but i don't think people generally started using it
until later: it required distros to update, and i think we can agree that it
was another release or two before it could be used as more of a drop in vs
project specific one-offs.
Gentoo: May 2009
Fedora: Nov 2009 (F13)

i don't have an opinion on the various behaviors of -T, but i think the number
parsing should be the same, and gold should be the one to change (even though
it kind of sucks).  accepting addresses in decimal is just weird tbh.

-- 
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 binutils/15835] binutils can't deal with more than one SHT_SYMTAB_SHNDX section (such as from Solaris or illumos link editor)

2015-08-26 Thread richard at netbsd dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=15835

Richard PALO  changed:

   What|Removed |Added

 CC||richard at netbsd dot org

--- Comment #6 from Richard PALO  ---
(In reply to Nick Clifton from comment #5)
> Hi Rich,
> 
>   Please could you try out the uploaded patch and let me know if it works
> for you.  It should allow the binutils to read files with multiple
> symtab_shndx sections, but it will not make the linker produce them.
> 
> Cheers
>   Nick

following this issue, tried the patch on binutils 2.25.1, unfortunately:

...
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DCP_ACP=1 -I. -I. -I./../include
-DHAVE_i386_elf32_sol2_vec -DHAVE_i386_coff_vec -DHAVE_x86_64_elf64_sol2_vec
-DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec
-DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec
-DBINDIR=\"/opt/local/bin\" -I/opt/local/include -I/usr/include -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wshadow -O2 -I/opt/local/include
-I/usr/include -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c elf.c -o elf.o
elf.c: In function 'assign_file_positions_for_non_load_sections':
elf.c:5075:9: warning: implicit declaration of function 'elf_symtab_shndx'
[-Wimplicit-function-declaration]
 || hdr == i_shdrpp[elf_symtab_shndx (abfd)]
 ^
elf.c: In function 'assign_file_positions_except_relocs':
elf.c:5333:13: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
|| i == elf_symtab_shndx (abfd)
 ^
elf.c: In function 'swap_out_syms':
elf.c:6909:39: error: 'struct elf_obj_tdata' has no member named
'symtab_shndx_hdr'
   symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
   ^

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