Summary:

    This optimisation will allow GCC to access more than one object from
    the same symbolic address. For example, suppose a section contains
    two variables x and y, and x and y are close together. The
    optimisation will create a common anchor point -- let's call it A --
    and allow both x and y to be accessed from A.

    The optimisation will of course be subject to the usual binding
    rules and will need to be aware of special cases like mergeable
    constants.

    At the moment, GCC makes no assumptions about the relative positions
    of static variables and constants, writing them out in a
    more-or-less arbitrary order. A major part of the project will
    therefore be to assign specific positions to objects and to write
    them out appropriately.

    The new infrastructure will also allow GCC to reorder objects within
    a section. Such a reordering might try to reduce the number of
    anchors or improve cache locality. However, this aspect of the
    project will be open-ended and isn't going to be part of the initial
    patch.

Full details here:

    http://gcc.gnu.org/wiki/Section%20Anchor%20Optimisations

Richard

Reply via email to