[Bug gas/18561] sh assembler wrongly constant-folds address expressions containing weak symbols

2015-08-24 Thread bugdal at aerifal dot cx
https://sourceware.org/bugzilla/show_bug.cgi?id=18561

--- Comment #13 from Rich Felker  ---
Nick, can you confirm that your latest patch does not break typical use of
.size like Alan Modra was concerned it would?

-- 
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/18561] sh assembler wrongly constant-folds address expressions containing weak symbols

2015-08-24 Thread bugdal at aerifal dot cx
https://sourceware.org/bugzilla/show_bug.cgi?id=18561

--- Comment #15 from Rich Felker  ---
Well that's not necessarily a show-stopper if there's a way to make it "work"
(evaluate at as-time) in .size or other contexts that aren't actually section
content and where a relocation cannot be emitted.

However, some of the older GCC versions I'm using that are affected by this but
and not easily patchable with Kazumoto Kojima's proposed patch for the GCC side
(GCC issue 66609) are even more broken with respect to this weak+hidden issue
even at the compiler level: they're inlining weak definitions! So unless I want
to spend a lot of effort fixing bugs that were fixed half a decade ago in
mainline GCC I think I just need to turn off all optimization based on
visibility, and that should fix this issue.

On the bright side, I think Kazumoto Kojima's patch works at least back to GCC
4.7 (with some minor adjustments to make it apply but no actual code changes).

TL;DR: I'm okay with closing this issue and dealing with everything on the GCC
side.

-- 
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/18561] sh assembler wrongly constant-folds address expressions containing weak symbols

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

--- Comment #14 from Nick Clifton  ---
Hi Rich,

(In reply to Rich Felker from comment #13)
> Nick, can you confirm that your latest patch does not break typical use of
> .size like Alan Modra was concerned it would?

Hmm, good point.  No, my patch would not work.  *sigh* It just feels wrong
allowing weak symbols to be resolved in expressions, but Alan is right, it is
the way gas works.

-- 
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/18561] sh assembler wrongly constant-folds address expressions containing weak symbols

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

Nick Clifton  changed:

   What|Removed |Added

   Attachment #8541|0   |1
is obsolete||

--- Comment #12 from Nick Clifton  ---
Created attachment 8545
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8545&action=edit
SH only fix for the problem.

Personally I think that we should not be evaluating the difference of two
different symbols when at least one of them is weak.  But since we obviously
have been doing this for a long time, I will let it stand.

Instead here is an SH specific patch to fix the problem.  It does not introduce
any regressions into the binutils testsuites for the various different SH
targets that I tried, so I think that it should be safe.

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


linking problem - mips32 Android

2015-08-24 Thread Andrzej Warzynski

Hello,

We've recently came across a weird behavior with ld, and I wanted to
check whether this is a known issue and what's the best way to solve it.

We're using ld to link position independent binaries (passing the -pie
flag) for mips32 devices running Android. The problem is that ld marks
such binaries as shared when parsing arguments. This is implemented in
the parse_args() function in the lexsup.c file:

case OPTION_PIE:
 if (config.has_shared)
 {
 link_info.shared = TRUE;
 link_info.pie = TRUE;
 }

However, having been compiled with -pie does not necessarily imply that
it is a shared object, it could be an executable. Indeed, Android
requires all binaries to be position independent (i.e. linked with the
-pie flag), both shared objects and executables.

The above situation is particularly problematic for us, because it
prevents the _bfd_mips_elf_size_dynamic_sections() function in the
elfxx-mips.c file from adding the DT_MIPS_RLD_MAP structure to the
.dynamic section. This is due to the following check on line 9786 in
elfxx-mips.c (binutils-2.25.1):

if (!info->shared && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP,
0))

This check means that DT_MIPS_RLD_MAP will not be added if the file
that's being processed is flagged as shared. The DT_MIPS_RLD_MAP
structure is used by debuggers to track loading and unloading of shared
objects. The above behavior (i.e. flagging all position independent
binaries as shared objects) renders debugging executables for mips32
Android impossible.

Is it necessary to flag all position independent executables as shared?
There's a bunch of easy workarounds, but we're not really sure what
would be the optimal solution.

Thank you,
Andrzej  Warzynski
--
Andrzej Warzynski
Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: http://www.codeplay.com
Twitter: https://twitter.com/codeplaysoft

This email and any attachments may contain confidential and /or 
privileged information and is for use by the addressee only. If you are 
not the intended recipient, please notify Codeplay Software Ltd 
immediately and delete the message from your computer. You may not copy 
or forward it, or use or disclose its contents to any other person. Any 
views or other information in this message which do not relate to our 
business are not authorized by Codeplay software Ltd, nor does this 
message form part of any contract unless so stated.

As internet communications

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/18859] Gold linker does not fully respect -no-as-needed

2015-08-24 Thread eugeni.stepanov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18859

--- Comment #4 from Evgeniy Stepanov  ---
Thank you!

--wrap does not work for prebuilt shared libraries, and we need to intercept at
least some functions in those, too (ex. malloc).

-- 
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-24 Thread aaro.koskinen at iki dot fi
https://sourceware.org/bugzilla/show_bug.cgi?id=18401

--- Comment #4 from Aaro Koskinen  ---
Is there any workaround to disable the "Inconsistent ISA" messages?

With arch=octeon+ GCC testsuite cannot be run anymore since every test fails
thanks to excess errors.

-- 
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-24 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

Stas Sergeev  changed:

   What|Removed |Added

 CC||stsp at users dot 
sourceforge.net

--- Comment #2 from Stas Sergeev  ---
Results in a broken build of dosemu.

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