aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-11-08 09:29:39 +0100
committerJan Beulich <jbeulich@suse.com>2023-11-08 09:29:39 +0100
commit80968745ee9fd6b48996e35adaf998d1ccf35642 (patch)
tree13db9b9122e77a8034bc52222b0f73b29b7d4c14 /gas
parentfb2908093576cc469c5ee8404070c8521631c019 (diff)
downloadgdb-80968745ee9fd6b48996e35adaf998d1ccf35642.zip
gdb-80968745ee9fd6b48996e35adaf998d1ccf35642.tar.gz
gdb-80968745ee9fd6b48996e35adaf998d1ccf35642.tar.bz2
gas: S_GET_{NAME,SEGMENT}() don't alter their input symbol
Make their parameters pointer-to-const, thus allowing callers to also be const-correct where possible.
Diffstat (limited to 'gas')
-rw-r--r--gas/symbols.c4
-rw-r--r--gas/symbols.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 45e46ed..b07ed24 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -2484,13 +2484,13 @@ S_IS_FORWARD_REF (const symbolS *s)
}
const char *
-S_GET_NAME (symbolS *s)
+S_GET_NAME (const symbolS *s)
{
return s->name;
}
segT
-S_GET_SEGMENT (symbolS *s)
+S_GET_SEGMENT (const symbolS *s)
{
if (s->flags.local_symbol)
return ((struct local_symbol *) s)->section;
diff --git a/gas/symbols.h b/gas/symbols.h
index 46425c9..55fae25 100644
--- a/gas/symbols.h
+++ b/gas/symbols.h
@@ -109,8 +109,8 @@ extern int S_IS_STABD (symbolS *);
extern int S_CAN_BE_REDEFINED (const symbolS *);
extern int S_IS_VOLATILE (const symbolS *);
extern int S_IS_FORWARD_REF (const symbolS *);
-extern const char *S_GET_NAME (symbolS *);
-extern segT S_GET_SEGMENT (symbolS *);
+extern const char *S_GET_NAME (const symbolS *);
+extern segT S_GET_SEGMENT (const symbolS *);
extern void S_SET_SEGMENT (symbolS *, segT);
extern void S_SET_EXTERNAL (symbolS *);
extern void S_SET_NAME (symbolS *, const char *);