diff --git a/include/compiler.h b/include/compiler.h index ed5384c7..312ac150 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -32,6 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef __GNUC__ # define ALIGNED(x) __attribute__((aligned(x))) +# define CONST_ATTR __attribute__((__const__)) # define UNUSED __attribute__((unused)) # define NOINLINE __attribute__((noinline)) # define NORETURN __attribute__((noreturn)) @@ -56,6 +57,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #else # define ALIGNED(x) # define ALWAYS_INLINE +# define CONST_ATTR # define UNUSED # define NOINLINE # define NORETURN diff --git a/src/arm/Gex_tables.c b/src/arm/Gex_tables.c index d78fbaf4..8004fb5f 100644 --- a/src/arm/Gex_tables.c +++ b/src/arm/Gex_tables.c @@ -53,7 +53,7 @@ struct arm_cb_data unw_dyn_info_t di; /* info about the ARM exidx segment */ }; -static inline uint32_t +static inline uint32_t CONST_ATTR prel31_read (uint32_t prel31) { return ((int32_t)prel31 << 1) >> 1; diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index 5adbb9a4..fd2bdae2 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -551,7 +551,7 @@ put_rs_cache (unw_addr_space_t as, struct dwarf_rs_cache *cache, lock_release (&cache->lock, *saved_maskp); } -static inline unw_hash_index_t +static inline unw_hash_index_t CONST_ATTR hash (unw_word_t ip) { /* based on (sqrt(5)/2-1)*2^64 */ diff --git a/src/ia64/Gparser.c b/src/ia64/Gparser.c index 88ea90f4..ff36968a 100644 --- a/src/ia64/Gparser.c +++ b/src/ia64/Gparser.c @@ -109,7 +109,7 @@ free_state_stack (struct ia64_reg_state *rs) /* Unwind decoder routines */ -static enum ia64_pregnum __attribute__ ((const)) +static enum ia64_pregnum CONST_ATTR decode_abreg (unsigned char abreg, int memory) { switch (abreg) diff --git a/src/ia64/Gscript.c b/src/ia64/Gscript.c index 13227b3f..5d8f2e1e 100644 --- a/src/ia64/Gscript.c +++ b/src/ia64/Gscript.c @@ -56,7 +56,7 @@ static __thread struct ia64_script_cache ia64_per_thread_cache = }; #endif -static inline unw_hash_index_t +static inline unw_hash_index_t CONST_ATTR hash (unw_word_t ip) { /* based on (sqrt(5)/2-1)*2^64 */