Changeset 3802 for trunk


Ignore:
Timestamp:
Feb 5, 2014, 7:46:01 PM (12 years ago)
Author:
bird
Message:

sys/sysctl.h: Try convince gcc to not remove the static sysctl data referenced by the set vector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/include/sys/sysctl.h

    r1931 r3802  
    217217#define DATA_SET(set, data) __asm__ (".stabs \"___libc_" #set "__\", 25, 0, 0, _" #data)
    218218
     219#if __GNUC_PREREQ__(4,2)
     220# define SYSCTL_DATA_USED() __attribute__((__used__))
     221#else
     222# define SYSCTL_DATA_USED()
     223#endif
     224
    219225/* This constructs a "raw" MIB oid. */
    220226#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
    221         static struct sysctl_oid __libc_sysctl__##parent##_##name = {            \
     227        static struct sysctl_oid SYSCTL_DATA_USED() __libc_sysctl__##parent##_##name = { \
    222228                &__libc_sysctl_##parent##_children, { &__libc_sysctl__##parent##_##name },                       \
    223229                nbr, kind, a1, a2, #name, handler, fmt, 0, descr };      \
Note: See TracChangeset for help on using the changeset viewer.