diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2018-09-20 15:49:01 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2018-09-20 15:49:01 +0100 |
commit | 16de26a611b78bd353af5b86ce67ace81ec1bfec (patch) | |
tree | 433aa85c947ad17ae71f85f55f265836daea9633 | |
parent | 53b6d6f5b2d8681cc4a061e05fe28ef896900908 (diff) | |
download | binutils-16de26a611b78bd353af5b86ce67ace81ec1bfec.zip binutils-16de26a611b78bd353af5b86ce67ace81ec1bfec.tar.gz binutils-16de26a611b78bd353af5b86ce67ace81ec1bfec.tar.bz2 |
PPC/GAS: Correct a signed vs unsigned comparison error with GCC 4.1
Fix a build error:
cc1: warnings being treated as errors
.../gas/config/tc-ppc.c: In function 'ppc_dwsect':
.../gas/config/tc-ppc.c:4091: warning: comparison between signed and unsigned
make[4]: *** [config/tc-ppc.o] Error 1
observed with GCC 4.1.2 with the `powerpc-beos' target.
Here `flag' identifies the type of a DWARF section, as used with the the
first operand to the `.dwsect' pseudo-op, and has no notion of a sign,
or for that matter being arithmetic in the first place[1]. We already
handle this correctly with the `flag' member of the `xcoff_dwsect_name'
structure, however not in the local variable used in GAS to hold the
parsed value of said `.dwsect' pseudo-op's operand.
Use an unsigned data type in GAS then too, observing that both `offsetT'
and `valueT' have the same width, as they correspond to `bfd_signed_vma'
and `bfd_vma' respectively.
References:
[1] "AIX Version 7.2: Assembler Language Reference", IBM Corporation
2015, 2018, Section ".dwsect pseudo-op", pp. 531-532
gas/
* config/tc-ppc.c (ppc_dwsect): Use `valueT' rather than
`offsetT' as the type of `flag'.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 47e1f7a..91af84b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2018-09-20 Maciej W. Rozycki <macro@linux-mips.org> + * config/tc-ppc.c (ppc_dwsect): Use `valueT' rather than + `offsetT' as the type of `flag'. + +2018-09-20 Maciej W. Rozycki <macro@linux-mips.org> + * config/tc-arc.c (md_number_to_chars_midend): Append `ull' to large constants. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index a44b300..d587a50 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -4077,7 +4077,7 @@ ppc_change_debug_section (unsigned int idx, subsegT subseg) static void ppc_dwsect (int ignore ATTRIBUTE_UNUSED) { - offsetT flag; + valueT flag; symbolS *opt_label; const struct xcoff_dwsect_name *dw; struct dw_subsection *subseg; |