lkml.org 
[lkml]   [2002]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] C undefined behavior fix
    Tom Rini writes:

    > Okay, here's a summary of all of the options we have:
    > 1) Change this particular strcpy to a memcpy
    > 2) Add -ffreestanding to the CFLAGS of arch/ppc/kernel/prom.o (If this
    > optimization comes back on with this flag later on, it would be a
    > compiler bug, yes?)
    > 3) Modify the RELOC() marco in such a way that GCC won't attempt to
    > optimize anything which touches it [1]. (Franz, again by Jakub)
    > 4) Introduce a function to do the calculations [2]. (Corey Minyard)
    > 5) 'Properly' set things up so that we don't need the RELOC() macros
    > (-mrelocatable or so?), and forget this mess altogether.

    I would add:

    6) change strcpy to string_copy so gcc doesn't think it knows what the
    function does
    7) code RELOC etc. in assembly, which would let us get rid of the
    offset = reloc_offset();
    at the beginning of each function which uses RELOC.

    Maybe 7 is the way to go, at least it will shut the bush-lawyers up.

    Paul.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:15    [W:6.298 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site