Bug 5523 - Confusing warning: "expression dangerous with linker stubs"
Summary: Confusing warning: "expression dangerous with linker stubs"
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
Depends on:
Reported: 2007-12-27 19:25 UTC by Joerg Wunsch
Modified: 2014-05-28 19:45 UTC (History)
2 users (show)

See Also:
Target: avr-*-*
Last reconfirmed:

Remove the warning (352 bytes, patch)
2008-01-07 16:44 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Wunsch 2007-12-27 19:25:58 UTC
This warning is emitted in line 648 of file gas/config/tc-avr.c.

This warning has been confusing a lot of users in the past, because it is
ultimately generated for legitimate assembly code generated by GCC as
part of jump tables resulting out of a larger switch statement.

Discussion with the author of the atmega256x patch, Björn Haase, resulted
in an agreement that the warning should just be removed.  There is indeed
a minimal danger that a switch statement could cross an 128 KiB boundary
where a linker stub could suddenly be placed within the table, but as the
assembler cannot reliably detect this situation at all, it confuses more
people with legitimate code (not crossing a 128 KiB boundary) than it
would be really able to help out those who are in danger.  In the end, the
users are told to ignore the warning, so it doesn't do any good at all.  In
addition, Björn pointed out that it could only detect part of the problem
but is not able to cover all possible dangerous cases, because some code
might hide dangerous operations between other assembly code that is not
covered by the warning.

If at all, this warning needs to be emitted by GCC itself whenever it
generates the possibly dangerous code.
Comment 1 Nick Clifton 2008-01-07 16:44:10 UTC
Created attachment 2177 [details]
Remove the warning
Comment 2 Nick Clifton 2008-01-07 16:45:46 UTC
Hi Joerg,

  Please could you try out the uploaded patch and let me know if it resolves the
problem for you ?

  Also - would it be possible for you to supply a small assembler source file
that demonstrates this problem ?  This could be turned in a gas test case to
make sure that the problem remains fixed.

Comment 3 Andy Hutchinson 2008-05-29 22:38:12 UTC
I applied this patch to Binutils-2.18.50

I ran full avr gcc testsuite and there were no regressions. Importantly, it
removed all the failures caused by the warning message removed by this patch.

So its get my vote!

Comment 4 Nick Clifton 2008-05-30 14:20:41 UTC
Hi Guys,

  I have checked the patch in.


	PR 5523
	* config/tc-avr.c (avr_ldi_expression): Do not warn about unknown
	relocs here.
Comment 5 Jackie Rosen 2014-02-16 17:47:03 UTC Comment hidden (spam)