public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
@ 2012-03-09 19:14 gjl at gcc dot gnu.org
  2012-03-09 19:18 ` [Bug other/52545] " gjl at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-09 19:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

             Bug #: 52545
           Summary: output.h: SECTION_EXCLUDE flag clobbers
                    SECTION_MACH_DEP
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org


All section flags from SECTION_MACH_DEP on are reserved for target specific
purposes and must not be allocated/used by any other flags like
SECTION_EXCLUDE.

Otherwise, setting a machine specific section flag might lead to
unintentionally mark a section as SECTION_EXCLUDE.

This bug is explicit for the AVR target that uses these flags (4 bits) to
encode target specific address spaces.

The output.h source comment reads:

#define SECTION_MACH_DEP 0x2000000    /* subsequent bits reserved for target */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
@ 2012-03-09 19:18 ` gjl at gcc dot gnu.org
  2012-03-09 19:22 ` gjl at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-09 19:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-09
                 CC|                            |tmsriram at google dot com
   Target Milestone|---                         |4.7.1
     Ever Confirmed|0                           |1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-09 19:17:52 UTC ---
FYI, this is the wrong line:

#define SECTION_EXCLUDE  0x4000000


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
  2012-03-09 19:18 ` [Bug other/52545] " gjl at gcc dot gnu.org
@ 2012-03-09 19:22 ` gjl at gcc dot gnu.org
  2012-03-09 19:37 ` tmsriram at google dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-09 19:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-09 19:21:09 UTC ---
...and here is the change:

http://gcc.gnu.org/viewcvs?view=revision&revision=179288


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
  2012-03-09 19:18 ` [Bug other/52545] " gjl at gcc dot gnu.org
  2012-03-09 19:22 ` gjl at gcc dot gnu.org
@ 2012-03-09 19:37 ` tmsriram at google dot com
  2012-03-09 20:28 ` gjl at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tmsriram at google dot com @ 2012-03-09 19:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #3 from Sriraman Tallam <tmsriram at google dot com> 2012-03-09 19:36:21 UTC ---
Right, I was not looking at SECTION_MACH_DEP when I defined the macro. Is it ok
to just bump SECTION_MACH_DEP?

The patch I have in mind is:

-#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
-#define SECTION_EXCLUDE  0x4000000
+#define SECTION_EXCLUDE 0x2000000
+#define SECTION_MACH_DEP 0x8000000 /* subsequent bits reserved for target */

I can bump SECTION_MACH_DEP even more to reserve more bits.

-Sri.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-03-09 19:37 ` tmsriram at google dot com
@ 2012-03-09 20:28 ` gjl at gcc dot gnu.org
  2012-03-09 21:31 ` tmsriram at google dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-09 20:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-09 20:27:42 UTC ---
(In reply to comment #3)
> Right, I was not looking at SECTION_MACH_DEP when I defined the macro. Is it ok
> to just bump SECTION_MACH_DEP?
> 
> The patch I have in mind is:
> 
> -#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
> -#define SECTION_EXCLUDE  0x4000000
> +#define SECTION_EXCLUDE 0x2000000
> +#define SECTION_MACH_DEP 0x8000000 /* subsequent bits reserved for target */
> 
> I can bump SECTION_MACH_DEP even more to reserve more bits.

The reserved bits start at SECTION_MACH_DEP, with the patch above you just
waste the bit at 0x4000000.

Any bits covered by 
  SECTION_MACH_DEP * (~0)
are reserved for the machine. The bigger SECTION_MACH_DEP is, the less bits are
left for machine specific needs.

Machine specific section flag masks could be, e.g.:

#define SECTION_FLAG_MACH_1 (SECTION_MACH_DEP)
#define SECTION_FLAG_MACH_2 (SECTION_MACH_DEP << 1)
#define SECTION_FLAG_MACH_3 (SECTION_MACH_DEP << 2)
...


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-03-09 20:28 ` gjl at gcc dot gnu.org
@ 2012-03-09 21:31 ` tmsriram at google dot com
  2012-03-12 18:23 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tmsriram at google dot com @ 2012-03-09 21:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #5 from Sriraman Tallam <tmsriram at google dot com> 2012-03-09 21:30:54 UTC ---
On Fri, Mar 9, 2012 at 12:27 PM, gjl at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545
>
> --- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-09 20:27:42 UTC ---
> (In reply to comment #3)
>> Right, I was not looking at SECTION_MACH_DEP when I defined the macro. Is it ok
>> to just bump SECTION_MACH_DEP?
>>
>> The patch I have in mind is:
>>
>> -#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
>> -#define SECTION_EXCLUDE  0x4000000
>> +#define SECTION_EXCLUDE 0x2000000
>> +#define SECTION_MACH_DEP 0x8000000 /* subsequent bits reserved for target */
>>
>> I can bump SECTION_MACH_DEP even more to reserve more bits.
>
> The reserved bits start at SECTION_MACH_DEP, with the patch above you just
> waste the bit at 0x4000000.

I thought I will leave some bits for future flags but I guess whoever
adds a flag can also bump SECTION_MACH_DEP. I will send a patch to fix
this.

Thanks,
-Sri.

>
> Any bits covered by
>  SECTION_MACH_DEP * (~0)
> are reserved for the machine. The bigger SECTION_MACH_DEP is, the less bits are
> left for machine specific needs.
>
> Machine specific section flag masks could be, e.g.:
>
> #define SECTION_FLAG_MACH_1 (SECTION_MACH_DEP)
> #define SECTION_FLAG_MACH_2 (SECTION_MACH_DEP << 1)
> #define SECTION_FLAG_MACH_3 (SECTION_MACH_DEP << 2)
> ...
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-03-09 21:31 ` tmsriram at google dot com
@ 2012-03-12 18:23 ` gjl at gcc dot gnu.org
  2012-03-22 10:49 ` gjl at gcc dot gnu.org
  2012-03-22 10:49 ` gjl at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-12 18:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-12 18:22:08 UTC ---
Author: gjl
Date: Mon Mar 12 18:22:01 2012
New Revision: 185259

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185259
Log:
    PR other/52545
    * output.h (SECTION_EXCLUDE, SECTION_MACH_DEP): Don't use
    SECTION_MACH_DEP reserved bits for SECTION_EXCLUDE.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/output.h


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-03-12 18:23 ` gjl at gcc dot gnu.org
@ 2012-03-22 10:49 ` gjl at gcc dot gnu.org
  2012-03-22 10:49 ` gjl at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-22 10:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-22 10:48:10 UTC ---
Fixed in 4.7.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/52545] output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP
  2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-03-22 10:49 ` gjl at gcc dot gnu.org
@ 2012-03-22 10:49 ` gjl at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-03-22 10:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-22 10:40:34 UTC ---
Author: gjl
Date: Thu Mar 22 10:40:31 2012
New Revision: 185685

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185685
Log:
    Backport from mainline r185259.
    PR other/52545
    * output.h (SECTION_EXCLUDE, SECTION_MACH_DEP): Don't use
    SECTION_MACH_DEP reserved bits for SECTION_EXCLUDE.


Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/output.h


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-03-22 10:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-09 19:14 [Bug other/52545] New: output.h: SECTION_EXCLUDE flag clobbers SECTION_MACH_DEP gjl at gcc dot gnu.org
2012-03-09 19:18 ` [Bug other/52545] " gjl at gcc dot gnu.org
2012-03-09 19:22 ` gjl at gcc dot gnu.org
2012-03-09 19:37 ` tmsriram at google dot com
2012-03-09 20:28 ` gjl at gcc dot gnu.org
2012-03-09 21:31 ` tmsriram at google dot com
2012-03-12 18:23 ` gjl at gcc dot gnu.org
2012-03-22 10:49 ` gjl at gcc dot gnu.org
2012-03-22 10:49 ` gjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).