aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/aout-target.h9
-rw-r--r--bfd/bfd-in2.h18
-rw-r--r--bfd/coff-rs6000.c2
-rw-r--r--bfd/coff64-rs6000.c2
-rw-r--r--bfd/coffcode.h2
-rw-r--r--bfd/elf-bfd.h4
-rw-r--r--bfd/elf-sframe.c9
-rw-r--r--bfd/elf.c61
-rw-r--r--bfd/elf64-x86-64.c7
-rw-r--r--bfd/elfxx-target.h2
-rw-r--r--bfd/libbfd-in.h9
-rw-r--r--bfd/libbfd.c10
-rw-r--r--bfd/libbfd.h9
-rw-r--r--bfd/libecoff.h3
-rw-r--r--bfd/libpei.h2
-rw-r--r--bfd/mach-o-target.c1
-rw-r--r--bfd/mach-o.c12
-rw-r--r--bfd/mach-o.h3
-rw-r--r--bfd/mmo.c1
-rw-r--r--bfd/peXXigen.c6
-rw-r--r--bfd/plugin.c5
-rw-r--r--bfd/ppcboot.c1
-rw-r--r--bfd/section.c7
-rw-r--r--bfd/som.c14
-rw-r--r--bfd/targets.c11
-rw-r--r--bfd/vms-alpha.c1
-rw-r--r--binutils/objcopy.c2
-rw-r--r--gas/atof-generic.c29
-rw-r--r--gas/cond.c7
-rw-r--r--gas/config/atof-ieee.c14
-rw-r--r--gas/config/kvx-parse.c6
-rw-r--r--gas/config/obj-elf.c9
-rw-r--r--gas/config/obj-macho.c6
-rw-r--r--gas/config/tc-csky.c12
-rw-r--r--gas/config/tc-dlx.c2
-rw-r--r--gas/config/tc-hppa.c19
-rw-r--r--gas/config/tc-ia64.c12
-rw-r--r--gas/config/tc-iq2000.c2
-rw-r--r--gas/config/tc-kvx.c4
-rw-r--r--gas/config/tc-loongarch.c2
-rw-r--r--gas/config/tc-m68k.c2
-rw-r--r--gas/config/tc-microblaze.c6
-rw-r--r--gas/config/tc-mips.c5
-rw-r--r--gas/config/tc-mmix.c25
-rw-r--r--gas/config/tc-mn10200.c10
-rw-r--r--gas/config/tc-mn10300.c15
-rw-r--r--gas/config/tc-nds32.c6
-rw-r--r--gas/config/tc-pru.c6
-rw-r--r--gas/config/tc-riscv.c6
-rw-r--r--gas/config/tc-s12z.c4
-rw-r--r--gas/config/tc-s390.c12
-rw-r--r--gas/config/tc-score.c28
-rw-r--r--gas/config/tc-score7.c6
-rw-r--r--gas/config/tc-sh.c3
-rw-r--r--gas/config/tc-sparc.c2
-rw-r--r--gas/config/tc-tic30.c8
-rw-r--r--gas/config/tc-tic54x.c20
-rw-r--r--gas/config/tc-tic6x.c8
-rw-r--r--gas/config/tc-tilegx.c14
-rw-r--r--gas/config/tc-tilepro.c12
-rw-r--r--gas/config/tc-visium.c22
-rw-r--r--gas/config/tc-xtensa.c4
-rw-r--r--gas/debug.c13
-rw-r--r--gas/ecoff.c7
-rw-r--r--gas/ehopt.c2
-rw-r--r--gas/expr.c4
-rw-r--r--gas/gen-sframe.c6
-rw-r--r--gas/input-scrub.c4
-rw-r--r--gas/listing.c16
-rw-r--r--gas/read.c10
-rw-r--r--gas/symbols.c6
-rw-r--r--gas/write.c4
-rw-r--r--include/sframe-api.h5
-rw-r--r--include/sframe-internal.h30
-rw-r--r--ld/ldlang.c4
-rw-r--r--ld/ldwrite.c2
76 files changed, 307 insertions, 367 deletions
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index 1b71104..c6d9d60 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -214,9 +214,11 @@ static bool
MY_bfd_copy_private_section_data (bfd *ibfd,
asection *isec ATTRIBUTE_UNUSED,
bfd *obfd,
- asection *osec ATTRIBUTE_UNUSED)
+ asection *osec ATTRIBUTE_UNUSED,
+ struct bfd_link_info *link_info)
{
- if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
+ if (link_info == NULL
+ && bfd_get_flavour (ibfd) == bfd_target_aout_flavour
&& bfd_get_flavour (obfd) == bfd_target_aout_flavour)
obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
return true;
@@ -562,9 +564,6 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#endif
-#define MY_init_private_section_data \
- _bfd_generic_init_private_section_data
-
#ifndef MY_bfd_copy_private_symbol_data
#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
#endif
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index d5d1b51..b013ef9 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1034,11 +1034,12 @@ bool bfd_malloc_and_get_section
(bfd *abfd, asection *section, bfd_byte **buf);
bool bfd_copy_private_section_data
- (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
+ (bfd *ibfd, asection *isec, bfd *obfd, asection *osec,
+ struct bfd_link_info *link_info);
-#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
+#define bfd_copy_private_section_data(ibfd, isec, obfd, osec, link_info) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
- (ibfd, isection, obfd, osection))
+ (ibfd, isec, obfd, osec, link_info))
bool bfd_generic_is_group_section (bfd *, const asection *sec);
const char *bfd_generic_group_name (bfd *, const asection *sec);
@@ -7636,7 +7637,6 @@ typedef struct bfd_target
#define BFD_JUMP_TABLE_COPY(NAME) \
NAME##_bfd_copy_private_bfd_data, \
NAME##_bfd_merge_private_bfd_data, \
- NAME##_init_private_section_data, \
NAME##_bfd_copy_private_section_data, \
NAME##_bfd_copy_private_symbol_data, \
NAME##_bfd_copy_private_header_data, \
@@ -7649,16 +7649,10 @@ typedef struct bfd_target
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
bool (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
- /* Called to initialize BFD private section data from one object file
- to another. */
-#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
- BFD_SEND (obfd, _bfd_init_private_section_data, \
- (ibfd, isec, obfd, osec, link_info))
- bool (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr,
- struct bfd_link_info *);
/* Called to copy BFD private section data from one object file
to another. */
- bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr);
+ bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr,
+ struct bfd_link_info *);
/* Called to copy BFD private symbol data from one symbol
to another. */
bool (*_bfd_copy_private_symbol_data) (bfd *, asymbol *,
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index ae9a0f6..3c18518 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -4456,8 +4456,6 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
#define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents
/* For copy private data entry points. */
-#define _bfd_xcoff_init_private_section_data \
- _bfd_generic_init_private_section_data
#define _bfd_xcoff_bfd_copy_private_bfd_data \
_bfd_xcoff_copy_private_bfd_data
#define _bfd_xcoff_bfd_merge_private_bfd_data \
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index ec7ed08..d335348 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -2621,7 +2621,6 @@ const bfd_target rs6000_xcoff64_vec =
/* Copy */
_bfd_xcoff_copy_private_bfd_data,
_bfd_generic_bfd_merge_private_bfd_data,
- _bfd_generic_init_private_section_data,
_bfd_generic_bfd_copy_private_section_data,
_bfd_generic_bfd_copy_private_symbol_data,
_bfd_generic_bfd_copy_private_header_data,
@@ -2892,7 +2891,6 @@ const bfd_target rs6000_xcoff64_aix_vec =
/* Copy */
_bfd_xcoff_copy_private_bfd_data,
_bfd_generic_bfd_merge_private_bfd_data,
- _bfd_generic_init_private_section_data,
_bfd_generic_bfd_copy_private_section_data,
_bfd_generic_bfd_copy_private_symbol_data,
_bfd_generic_bfd_copy_private_header_data,
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index bd0374f..b81195d 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -5955,8 +5955,6 @@ static const bfd_coff_backend_data bigobj_swap_table =
#define coff_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#endif
-#define coff_init_private_section_data _bfd_generic_init_private_section_data
-
#ifndef coff_bfd_copy_private_section_data
#define coff_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
#endif
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index f625709..2bd855a 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2393,10 +2393,8 @@ extern bool _bfd_elf_copy_private_header_data
(bfd *, bfd *);
extern bool _bfd_elf_copy_private_symbol_data
(bfd *, asymbol *, bfd *, asymbol *);
-extern bool _bfd_elf_init_private_section_data
- (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
extern bool _bfd_elf_copy_private_section_data
- (bfd *, asection *, bfd *, asection *);
+ (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
extern bool _bfd_elf_write_object_contents
(bfd *);
extern bool _bfd_elf_write_corefile_contents
diff --git a/bfd/elf-sframe.c b/bfd/elf-sframe.c
index 24a3d35..d74235b 100644
--- a/bfd/elf-sframe.c
+++ b/bfd/elf-sframe.c
@@ -23,6 +23,7 @@
#include "libbfd.h"
#include "elf-bfd.h"
#include "sframe-api.h"
+#include "sframe-internal.h"
/* Return TRUE if the function has been marked for deletion during the linking
process. */
@@ -373,8 +374,8 @@ _bfd_elf_merge_section_sframe (bfd *abfd,
uint8_t tflags = dctx_flags & ~SFRAME_F_FDE_SORTED;
/* ld always generates an output section with
SFRAME_F_FDE_FUNC_START_PCREL flag set. Later using
- SFRAME_F_LD_MUSTHAVE_FLAGS, it is enforced that the provided input
- sections also have this flag set. */
+ SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS, it is enforced that the provided
+ input sections also have this flag set. */
tflags |= SFRAME_F_FDE_FUNC_START_PCREL;
htab->sfe_info.sfe_ctx = sframe_encode (SFRAME_VERSION_2,
tflags, /* SFrame flags. */
@@ -430,8 +431,8 @@ _bfd_elf_merge_section_sframe (bfd *abfd,
related flags set. The implementation does not support updating these
data encodings on the fly; confirm by checking the ectx_flags. */
ectx_flags = sframe_encoder_get_flags (sfe_ctx);
- if ((dctx_flags & ectx_flags & SFRAME_F_LD_MUSTHAVE_FLAGS)
- != SFRAME_F_LD_MUSTHAVE_FLAGS)
+ if ((dctx_flags & ectx_flags & SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS)
+ != SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS)
{
_bfd_error_handler
(_("SFrame sections with unexpected data encoding prevent"
diff --git a/bfd/elf.c b/bfd/elf.c
index 07b2d0e..1eba142 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -8375,25 +8375,34 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
return rewrite_elf_program_header (ibfd, obfd, maxpagesize);
}
-/* Initialize private output section information from input section. */
+/* Copy private section information from input to output. This function
+ is called both by objcopy where LINK_INFO is NULL, and ld where
+ LINK_INFO is non-NULL in the usual case but NULL for a special case
+ when dealing with LTO IR or cloning output sections. */
bool
-_bfd_elf_init_private_section_data (bfd *ibfd,
+_bfd_elf_copy_private_section_data (bfd *ibfd,
asection *isec,
bfd *obfd,
asection *osec,
struct bfd_link_info *link_info)
-
{
- Elf_Internal_Shdr *ihdr, *ohdr;
- bool final_link = (link_info != NULL
- && !bfd_link_relocatable (link_info));
-
if (ibfd->xvec->flavour != bfd_target_elf_flavour
|| obfd->xvec->flavour != bfd_target_elf_flavour)
return true;
- BFD_ASSERT (elf_section_data (osec) != NULL);
+ Elf_Internal_Shdr *ihdr = &elf_section_data (isec)->this_hdr;
+ Elf_Internal_Shdr *ohdr = &elf_section_data (osec)->this_hdr;
+ if (link_info == NULL)
+ {
+ ohdr->sh_entsize = ihdr->sh_entsize;
+
+ if (ihdr->sh_type == SHT_SYMTAB
+ || ihdr->sh_type == SHT_DYNSYM
+ || ihdr->sh_type == SHT_GNU_verneed
+ || ihdr->sh_type == SHT_GNU_verdef)
+ ohdr->sh_info = ihdr->sh_info;
+ }
/* If this is a known ABI section, ELF section type and flags may
have been set up when OSEC was created. For normal sections we
@@ -8403,11 +8412,14 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
|| elf_section_type (osec) == SHT_NOTE
|| elf_section_type (osec) == SHT_NOBITS)
elf_section_type (osec) = SHT_NULL;
+
/* For objcopy and relocatable link, copy the ELF section type from
the input file if the BFD section flags are the same. (If they
are different the user may be doing something like
"objcopy --set-section-flags .text=alloc,data".) For a final
link allow some flags that the linker clears to differ. */
+ bool final_link = (link_info != NULL
+ && !bfd_link_relocatable (link_info));
if (elf_section_type (osec) == SHT_NULL
&& (osec->flags == isec->flags
|| (final_link
@@ -8445,14 +8457,11 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
elf_section_flags (osec) |= (elf_section_flags (isec)
& SHF_COMPRESSED);
- ihdr = &elf_section_data (isec)->this_hdr;
-
/* We need to handle elf_linked_to_section for SHF_LINK_ORDER. We
don't use the output section of the linked-to section since it
may be NULL at this point. */
if ((ihdr->sh_flags & SHF_LINK_ORDER) != 0)
{
- ohdr = &elf_section_data (osec)->this_hdr;
ohdr->sh_flags |= SHF_LINK_ORDER;
elf_linked_to_section (osec) = elf_linked_to_section (isec);
}
@@ -8462,36 +8471,6 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
return true;
}
-/* Copy private section information. This copies over the entsize
- field, and sometimes the info field. */
-
-bool
-_bfd_elf_copy_private_section_data (bfd *ibfd,
- asection *isec,
- bfd *obfd,
- asection *osec)
-{
- Elf_Internal_Shdr *ihdr, *ohdr;
-
- if (ibfd->xvec->flavour != bfd_target_elf_flavour
- || obfd->xvec->flavour != bfd_target_elf_flavour)
- return true;
-
- ihdr = &elf_section_data (isec)->this_hdr;
- ohdr = &elf_section_data (osec)->this_hdr;
-
- ohdr->sh_entsize = ihdr->sh_entsize;
-
- if (ihdr->sh_type == SHT_SYMTAB
- || ihdr->sh_type == SHT_DYNSYM
- || ihdr->sh_type == SHT_GNU_verneed
- || ihdr->sh_type == SHT_GNU_verdef)
- ohdr->sh_info = ihdr->sh_info;
-
- return _bfd_elf_init_private_section_data (ibfd, isec, obfd, osec,
- NULL);
-}
-
/* Look at all the SHT_GROUP sections in IBFD, making any adjustments
necessary if we are removing either the SHT_GROUP section or any of
the group member sections. DISCARDED is the value that a section's
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index b9b3cf8..c40a0c5 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -6136,13 +6136,14 @@ elf_x86_64_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
static bool
elf_x86_64_copy_private_section_data (bfd *ibfd, asection *isec,
- bfd *obfd, asection *osec)
+ bfd *obfd, asection *osec,
+ struct bfd_link_info *link_info)
{
- if (!_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec))
+ if (!_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec, link_info))
return false;
/* objcopy --set-section-flags without "large" drops SHF_X86_64_LARGE. */
- if (ibfd != obfd)
+ if (link_info == NULL && ibfd != obfd)
elf_section_flags (osec) &= ~SHF_X86_64_LARGE;
return true;
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 625243c..4cf02bb 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -225,8 +225,6 @@
_bfd_elf_copy_private_symbol_data
#endif
-#define bfd_elfNN_init_private_section_data \
- _bfd_elf_init_private_section_data
#ifndef bfd_elfNN_bfd_copy_private_section_data
#define bfd_elfNN_bfd_copy_private_section_data \
_bfd_elf_copy_private_section_data
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index ae6d303..213cc7d 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -270,17 +270,14 @@ extern bool _bfd_generic_get_section_contents
#define _bfd_generic_bfd_merge_private_bfd_data \
_bfd_bool_bfd_link_true
#define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true
-#define _bfd_generic_bfd_copy_private_section_data \
- _bfd_bool_bfd_asection_bfd_asection_true
+extern bool _bfd_generic_bfd_copy_private_section_data
+ (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
+ ATTRIBUTE_HIDDEN;
#define _bfd_generic_bfd_copy_private_symbol_data \
_bfd_bool_bfd_asymbol_bfd_asymbol_true
#define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true
#define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true
-extern bool _bfd_generic_init_private_section_data
- (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
- ATTRIBUTE_HIDDEN;
-
/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index f2daf79..6587fc1 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -1514,11 +1514,11 @@ _bfd_write_unsigned_leb128 (bfd_byte *p, bfd_byte *end, bfd_vma val)
}
bool
-_bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
- asection *isec ATTRIBUTE_UNUSED,
- bfd *obfd ATTRIBUTE_UNUSED,
- asection *osec ATTRIBUTE_UNUSED,
- struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
+_bfd_generic_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
+ asection *isec ATTRIBUTE_UNUSED,
+ bfd *obfd ATTRIBUTE_UNUSED,
+ asection *osec ATTRIBUTE_UNUSED,
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
{
return true;
}
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 3cb3c14..bab1f71 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -276,17 +276,14 @@ extern bool _bfd_generic_get_section_contents
#define _bfd_generic_bfd_merge_private_bfd_data \
_bfd_bool_bfd_link_true
#define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true
-#define _bfd_generic_bfd_copy_private_section_data \
- _bfd_bool_bfd_asection_bfd_asection_true
+extern bool _bfd_generic_bfd_copy_private_section_data
+ (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
+ ATTRIBUTE_HIDDEN;
#define _bfd_generic_bfd_copy_private_symbol_data \
_bfd_bool_bfd_asymbol_bfd_asymbol_true
#define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true
#define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true
-extern bool _bfd_generic_init_private_section_data
- (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
- ATTRIBUTE_HIDDEN;
-
/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */
diff --git a/bfd/libecoff.h b/bfd/libecoff.h
index 51a00e0..08b601d 100644
--- a/bfd/libecoff.h
+++ b/bfd/libecoff.h
@@ -250,9 +250,6 @@ extern bool _bfd_ecoff_get_section_contents
#define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section
#define _bfd_ecoff_bfd_link_check_relocs _bfd_generic_link_check_relocs
-#define _bfd_ecoff_init_private_section_data \
- _bfd_generic_init_private_section_data
-
extern bool _bfd_ecoff_bfd_copy_private_bfd_data
(bfd *, bfd *);
#define _bfd_ecoff_bfd_copy_private_section_data \
diff --git a/bfd/libpei.h b/bfd/libpei.h
index 4932fb1..fc1ada2 100644
--- a/bfd/libpei.h
+++ b/bfd/libpei.h
@@ -473,7 +473,7 @@ CODEVIEW_INFO *_bfd_XXi_slurp_codeview_record
unsigned _bfd_XX_only_swap_filehdr_out (bfd *, void *, void *);
unsigned _bfd_XXi_only_swap_filehdr_out (bfd *, void *, void *);
bool _bfd_XX_bfd_copy_private_section_data
- (bfd *, asection *, bfd *, asection *);
+ (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c
index fa1953f..e402d3a 100644
--- a/bfd/mach-o-target.c
+++ b/bfd/mach-o-target.c
@@ -74,7 +74,6 @@
#define bfd_mach_o_write_armap _bfd_noarchive_write_armap
#define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index
#define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp
-#define bfd_mach_o_init_private_section_data _bfd_generic_init_private_section_data
#define TARGET_NAME_BACKEND XCONCAT2(TARGET_NAME,_backend)
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index fb5bde1..cc191b9 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -583,15 +583,17 @@ bfd_mach_o_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED,
bool
bfd_mach_o_bfd_copy_private_section_data (bfd *ibfd, asection *isection,
- bfd *obfd, asection *osection)
+ bfd *obfd, asection *osection,
+ struct bfd_link_info *link_info)
{
- bfd_mach_o_section *os = bfd_mach_o_get_mach_o_section (osection);
- bfd_mach_o_section *is = bfd_mach_o_get_mach_o_section (isection);
-
- if (ibfd->xvec->flavour != bfd_target_mach_o_flavour
+ if (link_info != NULL
+ || ibfd->xvec->flavour != bfd_target_mach_o_flavour
|| obfd->xvec->flavour != bfd_target_mach_o_flavour)
return true;
+ bfd_mach_o_section *os = bfd_mach_o_get_mach_o_section (osection);
+ bfd_mach_o_section *is = bfd_mach_o_get_mach_o_section (isection);
+
BFD_ASSERT (is != NULL && os != NULL);
os->flags = is->flags;
diff --git a/bfd/mach-o.h b/bfd/mach-o.h
index 3aaae38..1cda072 100644
--- a/bfd/mach-o.h
+++ b/bfd/mach-o.h
@@ -691,7 +691,8 @@ bool bfd_mach_o_write_contents (bfd *);
bool bfd_mach_o_bfd_copy_private_symbol_data (bfd *, asymbol *,
bfd *, asymbol *);
bool bfd_mach_o_bfd_copy_private_section_data (bfd *, asection *,
- bfd *, asection *);
+ bfd *, asection *,
+ struct bfd_link_info *);
bool bfd_mach_o_bfd_copy_private_header_data (bfd *, bfd *);
bool bfd_mach_o_bfd_set_private_flags (bfd *, flagword);
bool bfd_mach_o_bfd_print_private_bfd_data (bfd *, void *);
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 1b1eb87..762aeff 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3350,7 +3350,6 @@ mmo_write_object_contents (bfd *abfd)
#define mmo_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
-#define mmo_init_private_section_data _bfd_generic_init_private_section_data
const bfd_target mmix_mmo_vec =
{
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 19f38a4..c337fc5 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -3115,9 +3115,11 @@ bool
_bfd_XX_bfd_copy_private_section_data (bfd *ibfd,
asection *isec,
bfd *obfd,
- asection *osec)
+ asection *osec,
+ struct bfd_link_info *link_info)
{
- if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour
+ if (link_info != NULL
+ || bfd_get_flavour (ibfd) != bfd_target_coff_flavour
|| bfd_get_flavour (obfd) != bfd_target_coff_flavour)
return true;
diff --git a/bfd/plugin.c b/bfd/plugin.c
index d57ae59..1c72b74 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -73,8 +73,6 @@ dlerror (void)
#define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
#define bfd_plugin_new_section_hook _bfd_generic_new_section_hook
#define bfd_plugin_get_section_contents _bfd_generic_get_section_contents
-#define bfd_plugin_init_private_section_data _bfd_generic_init_private_section_data
-#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
@@ -782,7 +780,8 @@ static bool
bfd_plugin_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
asection *isection ATTRIBUTE_UNUSED,
bfd *obfd ATTRIBUTE_UNUSED,
- asection *osection ATTRIBUTE_UNUSED)
+ asection *osection ATTRIBUTE_UNUSED,
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
{
BFD_ASSERT (0);
return true;
diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c
index b4b59c9..dd70267 100644
--- a/bfd/ppcboot.c
+++ b/bfd/ppcboot.c
@@ -474,7 +474,6 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
#define ppcboot_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#define ppcboot_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define ppcboot_init_private_section_data _bfd_generic_init_private_section_data
#define ppcboot_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
#define ppcboot_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
#define ppcboot_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
diff --git a/bfd/section.c b/bfd/section.c
index 9460ff9..5f0cf6e 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1667,7 +1667,8 @@ FUNCTION
SYNOPSIS
bool bfd_copy_private_section_data
- (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
+ (bfd *ibfd, asection *isec, bfd *obfd, asection *osec,
+ struct bfd_link_info *link_info);
DESCRIPTION
Copy private section information from @var{isec} in the BFD
@@ -1678,9 +1679,9 @@ DESCRIPTION
o <<bfd_error_no_memory>> -
Not enough memory exists to create private data for @var{osec}.
-.#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
+.#define bfd_copy_private_section_data(ibfd, isec, obfd, osec, link_info) \
. BFD_SEND (obfd, _bfd_copy_private_section_data, \
-. (ibfd, isection, obfd, osection))
+. (ibfd, isec, obfd, osec, link_info))
*/
/*
diff --git a/bfd/som.c b/bfd/som.c
index d3e0876..5c60f60 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -5372,17 +5372,17 @@ static bool
som_bfd_copy_private_section_data (bfd *ibfd,
asection *isection,
bfd *obfd,
- asection *osection)
+ asection *osection,
+ struct bfd_link_info *link_info)
{
- size_t amt;
-
/* One day we may try to grok other private data. */
- if (ibfd->xvec->flavour != bfd_target_som_flavour
+ if (link_info != NULL
+ || ibfd->xvec->flavour != bfd_target_som_flavour
|| obfd->xvec->flavour != bfd_target_som_flavour
|| (!som_is_space (isection) && !som_is_subspace (isection)))
return true;
- amt = sizeof (struct som_copyable_section_data_struct);
+ size_t amt = sizeof (struct som_copyable_section_data_struct);
som_section_data (osection)->copy_data = bfd_zalloc (obfd, amt);
if (som_section_data (osection)->copy_data == NULL)
return false;
@@ -5401,7 +5401,8 @@ som_bfd_copy_private_section_data (bfd *ibfd,
{
/* User has specified a subspace without its containing space. */
_bfd_error_handler (_("%pB[%pA]: no output section for space %pA"),
- obfd, osection, som_section_data (osection)->copy_data->container);
+ obfd, osection,
+ som_section_data (osection)->copy_data->container);
return false;
}
}
@@ -6779,7 +6780,6 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
#define som_bfd_link_hide_symbol _bfd_generic_link_hide_symbol
#define som_bfd_define_start_stop bfd_generic_define_start_stop
#define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define som_init_private_section_data _bfd_generic_init_private_section_data
#define som_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define som_find_inliner_info _bfd_nosymbols_find_inliner_info
diff --git a/bfd/targets.c b/bfd/targets.c
index 18f5782..2333370 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -282,7 +282,6 @@ BFD_JUMP_TABLE macros.
.#define BFD_JUMP_TABLE_COPY(NAME) \
. NAME##_bfd_copy_private_bfd_data, \
. NAME##_bfd_merge_private_bfd_data, \
-. NAME##_init_private_section_data, \
. NAME##_bfd_copy_private_section_data, \
. NAME##_bfd_copy_private_symbol_data, \
. NAME##_bfd_copy_private_header_data, \
@@ -295,16 +294,10 @@ BFD_JUMP_TABLE macros.
. {* Called to merge BFD general private data from one object file
. to a common output file when linking. *}
. bool (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
-. {* Called to initialize BFD private section data from one object file
-. to another. *}
-.#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
-. BFD_SEND (obfd, _bfd_init_private_section_data, \
-. (ibfd, isec, obfd, osec, link_info))
-. bool (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr,
-. struct bfd_link_info *);
. {* Called to copy BFD private section data from one object file
. to another. *}
-. bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr);
+. bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr,
+. struct bfd_link_info *);
. {* Called to copy BFD private symbol data from one symbol
. to another. *}
. bool (*_bfd_copy_private_symbol_data) (bfd *, asymbol *,
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index 548a979..c4b2484 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -10156,7 +10156,6 @@ bfd_vms_get_data (bfd *abfd)
#define vms_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#define vms_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define vms_init_private_section_data _bfd_generic_init_private_section_data
#define vms_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
#define vms_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
#define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 2e98ba4..8c90773 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -4398,7 +4398,7 @@ setup_section (bfd *ibfd, sec_ptr isection, bfd *obfd)
/* Allow the BFD backend to copy any private data it understands
from the input section to the output section. */
- if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection))
+ if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection, NULL))
err = _("failed to copy private data");
if (make_nobits)
diff --git a/gas/atof-generic.c b/gas/atof-generic.c
index 944f209..59d1110 100644
--- a/gas/atof-generic.c
+++ b/gas/atof-generic.c
@@ -351,7 +351,6 @@ atof_generic (/* return pointer to just AFTER number we read. */
unsigned int more_than_enough_bits_for_digits;
unsigned int more_than_enough_littlenums_for_digits;
unsigned int size_of_digits_in_littlenums;
- unsigned int size_of_digits_in_chars;
FLONUM_TYPE power_of_10_flonum;
FLONUM_TYPE digits_flonum;
@@ -375,11 +374,8 @@ atof_generic (/* return pointer to just AFTER number we read. */
number_of_digits_to_use = number_of_digits_available;
}
- /* Cast these to SIGNED LONG first, otherwise, on systems with
- LONG wider than INT (such as Alpha OSF/1), unsignedness may
- cause unexpected results. */
- decimal_exponent += ((long) number_of_digits_before_decimal
- - (long) number_of_digits_to_use);
+ decimal_exponent += number_of_digits_before_decimal;
+ decimal_exponent -= number_of_digits_to_use;
more_than_enough_bits_for_digits
= (number_of_digits_to_use * 3321928 / 1000000 + 1);
@@ -398,13 +394,9 @@ atof_generic (/* return pointer to just AFTER number we read. */
object). */
size_of_digits_in_littlenums = more_than_enough_littlenums_for_digits;
- size_of_digits_in_chars = size_of_digits_in_littlenums
- * sizeof (LITTLENUM_TYPE);
- digits_binary_low = (LITTLENUM_TYPE *)
- xmalloc (size_of_digits_in_chars);
-
- memset ((char *) digits_binary_low, '\0', size_of_digits_in_chars);
+ digits_binary_low = xcalloc (size_of_digits_in_littlenums,
+ sizeof (LITTLENUM_TYPE));
/* Digits_binary_low[] is allocated and zeroed. */
@@ -514,13 +506,13 @@ atof_generic (/* return pointer to just AFTER number we read. */
/* From now on: the decimal exponent is > 0. Its sign is separate. */
- size_of_power_in_chars = size_of_power_in_littlenums
- * sizeof (LITTLENUM_TYPE) + 2;
+ size_of_power_in_chars = (size_of_power_in_littlenums
+ * sizeof (LITTLENUM_TYPE)) + 2;
- power_binary_low = (LITTLENUM_TYPE *) xmalloc (size_of_power_in_chars);
- temporary_binary_low = (LITTLENUM_TYPE *) xmalloc (size_of_power_in_chars);
+ power_binary_low = xmalloc (size_of_power_in_chars);
+ temporary_binary_low = xmalloc (size_of_power_in_chars);
- memset ((char *) power_binary_low, '\0', size_of_power_in_chars);
+ memset (power_binary_low, '\0', size_of_power_in_chars);
*power_binary_low = 1;
power_of_10_flonum.exponent = 0;
power_of_10_flonum.low = power_binary_low;
@@ -632,8 +624,7 @@ atof_generic (/* return pointer to just AFTER number we read. */
#ifdef TRACE
static void
-flonum_print (f)
- const FLONUM_TYPE *f;
+flonum_print (const FLONUM_TYPE *f)
{
LITTLENUM_TYPE *lp;
char littlenum_format[10];
diff --git a/gas/cond.c b/gas/cond.c
index 2e3b3fd..56e8c72 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -504,7 +504,7 @@ ignore_input (void)
else
{
if (s[-1] != '.')
- return (current_cframe != NULL) && (current_cframe->ignoring);
+ return current_cframe != NULL && current_cframe->ignoring;
}
/* We cannot ignore certain pseudo ops. */
@@ -526,15 +526,14 @@ ignore_input (void)
break;
}
- return (current_cframe != NULL) && (current_cframe->ignoring);
+ return current_cframe != NULL && current_cframe->ignoring;
}
static void
initialize_cframe (struct conditional_frame *cframe)
{
memset (cframe, 0, sizeof (*cframe));
- cframe->if_file_line.file
- = as_where (&cframe->if_file_line.line);
+ cframe->if_file_line.file = as_where (&cframe->if_file_line.line);
cframe->previous_cframe = current_cframe;
cframe->dead_tree = current_cframe != NULL && current_cframe->ignoring;
cframe->macro_nest = macro_nest;
diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c
index 92b9f74..a1c3ca2 100644
--- a/gas/config/atof-ieee.c
+++ b/gas/config/atof-ieee.c
@@ -147,12 +147,12 @@ make_invalid_floating_point_number (LITTLENUM_TYPE *words)
{
as_bad (_("cannot create floating-point number"));
/* Zero the leftmost bit. */
- words[0] = (LITTLENUM_TYPE) ((unsigned) -1) >> 1;
- words[1] = (LITTLENUM_TYPE) -1;
- words[2] = (LITTLENUM_TYPE) -1;
- words[3] = (LITTLENUM_TYPE) -1;
- words[4] = (LITTLENUM_TYPE) -1;
- words[5] = (LITTLENUM_TYPE) -1;
+ words[0] = (LITTLENUM_TYPE) -1 >> 1;
+ words[1] = -1;
+ words[2] = -1;
+ words[3] = -1;
+ words[4] = -1;
+ words[5] = -1;
}
/* Build a floating point constant at str into a IEEE floating
@@ -283,7 +283,7 @@ atof_ieee (char *str, /* Text to convert to binary. */
default:
make_invalid_floating_point_number (words);
- return (NULL);
+ return NULL;
}
return atof_ieee_detail (str, precision, exponent_bits, words, NULL);
diff --git a/gas/config/kvx-parse.c b/gas/config/kvx-parse.c
index 06b21c9..ea96f3d 100644
--- a/gas/config/kvx-parse.c
+++ b/gas/config/kvx-parse.c
@@ -458,7 +458,7 @@ get_token_class (struct token_s *token, struct token_classes *classes, int insn_
{
int cur = 0;
int found = 0;
- int tok_sz = token->end - token->begin;
+ size_t tok_sz = token->end - token->begin;
char *tok = token->insn + token->begin;
expressionS exp;
@@ -557,7 +557,7 @@ get_token_class (struct token_s *token, struct token_classes *classes, int insn_
for (int i = 0; !found && i < class[cur].sz; ++i)
{
const char *ref = class[cur].class_values[i];
- found = ((long) strlen (ref) == tok_sz) && !strncmp (tok, ref, tok_sz);
+ found = (strlen (ref) == tok_sz) && !strncmp (tok, ref, tok_sz);
token->val = i;
}
@@ -669,7 +669,7 @@ static struct token_list *
create_token (struct token_s tok, int len, int loc)
{
struct token_list *tl = calloc (1, sizeof *tl);
- int tok_sz = tok.end - tok.begin;
+ size_t tok_sz = tok.end - tok.begin;
tl->tok = calloc (tok_sz + 1, sizeof (char));
memcpy (tl->tok, tok.insn + tok.begin, tok_sz * sizeof (char));
tl->val = tok.val;
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 6ca2433..03b6c24 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1228,7 +1228,7 @@ obj_elf_section (int push)
if (push && ISDIGIT (*input_line_pointer))
{
/* .pushsection has an optional subsection. */
- new_subsection = (subsegT) get_absolute_expression ();
+ new_subsection = get_absolute_expression ();
SKIP_WHITESPACE ();
@@ -1459,7 +1459,7 @@ obj_elf_section (int push)
char *t = input_line_pointer;
match.sh_info = strtoul (input_line_pointer,
&input_line_pointer, 0);
- if (match.sh_info == (unsigned int) -1)
+ if (match.sh_info == -1u)
{
as_warn (_("unsupported mbind section info: %s"), t);
match.sh_info = 0;
@@ -1496,8 +1496,7 @@ obj_elf_section (int push)
errno = 0;
id = strtoul (input_line_pointer,
&input_line_pointer, 0);
- overflow = (id == (unsigned long) -1
- && errno == ERANGE);
+ overflow = id == -1ul && errno == ERANGE;
}
else
{
@@ -1506,7 +1505,7 @@ obj_elf_section (int push)
(const char **) &input_line_pointer, 0);
overflow = id == ~(bfd_vma) 0;
}
- if (overflow || id > (unsigned int) -1)
+ if (overflow || id > -1u)
{
char *linefeed, saved_char = 0;
if ((linefeed = strchr (t, '\n')) != NULL)
diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
index 17bb697..01e76c5 100644
--- a/gas/config/obj-macho.c
+++ b/gas/config/obj-macho.c
@@ -531,8 +531,8 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED)
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{
- align = (unsigned int) parse_align (0);
- if (align == (unsigned int) -1)
+ align = parse_align (0);
+ if (align == -1u)
{
as_warn (_("align value not recognized, using size"));
align = size;
@@ -1800,7 +1800,7 @@ obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec,
entry size, we're dead ... */
gas_assert (eltsiz != 0);
- ncalc = (unsigned int) (sect_size / eltsiz);
+ ncalc = sect_size / eltsiz;
if (nactual != ncalc)
as_bad (_("the number of .indirect_symbols defined in section %s"
" does not match the number expected (%d defined, %d"
diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c
index cfd0b37..dc8ee74 100644
--- a/gas/config/tc-csky.c
+++ b/gas/config/tc-csky.c
@@ -5596,25 +5596,25 @@ md_apply_fix (fixS *fixP,
case BFD_RELOC_CKCORE_PCREL_IMM8BY4:
case BFD_RELOC_CKCORE_PCREL_IMM10BY4:
case BFD_RELOC_CKCORE_PCREL_IMM16BY4:
- max = (offsetT) howto->dst_mask;
+ max = howto->dst_mask;
min = 0;
break;
/* lrw16. */
case BFD_RELOC_CKCORE_PCREL_IMM7BY4:
if (do_extend_lrw)
- max = (offsetT)((1 << (howto->bitsize + 1)) - 2);
+ max = ((valueT) 1 << (howto->bitsize + 1)) - 2;
else
- max = (offsetT)((1 << howto->bitsize) - 1);
+ max = ((valueT) 1 << howto->bitsize) - 1;
min = 0;
break;
/* flrws, flrwd: the offset bits are divided in two parts. */
case BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4:
- max = (offsetT)((1 << howto->bitsize) - 1);
+ max = ((valueT) 1 << howto->bitsize) - 1;
min = 0;
break;
/* Offset is signed. */
default:
- max = (offsetT)(howto->dst_mask >> 1);
+ max = howto->dst_mask >> 1;
min = - max - 1;
issigned = 1;
}
@@ -5630,7 +5630,7 @@ md_apply_fix (fixS *fixP,
if (do_extend_lrw && (opcode & 0xfc00) == CSKYV2_INST_LRW16)
val &= 0xff;
else
- val &= issigned ? (offsetT)(howto->dst_mask) : max;
+ val &= issigned ? (offsetT) howto->dst_mask : max;
if (fixP->fx_r_type == BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4)
val = (val & 0xf) << 12;
diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c
index 08948d2..69c8f49 100644
--- a/gas/config/tc-dlx.c
+++ b/gas/config/tc-dlx.c
@@ -539,7 +539,7 @@ static char *
fix_ld_st_operand (unsigned long opcode, char* str)
{
/* Check the opcode. */
- switch ((int) opcode)
+ switch (opcode)
{
case LBOP:
case LBUOP:
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index a22d094..744613f 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1562,7 +1562,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
if (fragP->fr_type == rs_machine_dependent)
{
- switch ((int) fragP->fr_subtype)
+ switch (fragP->fr_subtype)
{
case 0:
fragP->fr_type = rs_fill;
@@ -6615,7 +6615,7 @@ pa_type_args (symbolS *symbolP, int is_export)
than BFD understands. This is how we get this information
to the SOM BFD backend. */
#ifdef obj_set_symbol_type
- obj_set_symbol_type (bfdsym, (int) type);
+ obj_set_symbol_type (bfdsym, type);
#else
(void) type;
#endif
@@ -7548,7 +7548,6 @@ pa_subspace (int create_new)
/* Now that all the flags are set, update an existing subspace,
or create a new one. */
if (ssd)
-
current_subspace = update_subspace (space, ss_name, loadable,
code_only, comdat, common,
dup_common, sort, zero, access_ctr,
@@ -7973,7 +7972,7 @@ pa_subsegment_to_subspace (asection *seg, subsegT subseg)
for (subspace_chain = space_chain->sd_subspaces;
subspace_chain;
subspace_chain = subspace_chain->ssd_next)
- if (subspace_chain->ssd_subseg == (int) subseg)
+ if (subspace_chain->ssd_subseg == subseg)
return subspace_chain;
}
}
@@ -8432,12 +8431,12 @@ hppa_force_relocation (struct fix *fixp)
hppa_fixp = fixp->tc_fix_data;
#ifdef OBJ_SOM
- if (fixp->fx_r_type == (int) R_HPPA_ENTRY
- || fixp->fx_r_type == (int) R_HPPA_EXIT
- || fixp->fx_r_type == (int) R_HPPA_BEGIN_BRTAB
- || fixp->fx_r_type == (int) R_HPPA_END_BRTAB
- || fixp->fx_r_type == (int) R_HPPA_BEGIN_TRY
- || fixp->fx_r_type == (int) R_HPPA_END_TRY
+ if (fixp->fx_r_type == R_HPPA_ENTRY
+ || fixp->fx_r_type == R_HPPA_EXIT
+ || fixp->fx_r_type == R_HPPA_BEGIN_BRTAB
+ || fixp->fx_r_type == R_HPPA_END_BRTAB
+ || fixp->fx_r_type == R_HPPA_BEGIN_TRY
+ || fixp->fx_r_type == R_HPPA_END_TRY
|| (fixp->fx_addsy != NULL && fixp->fx_subsy != NULL
&& (hppa_fixp->segment->flags & SEC_CODE) != 0))
return 1;
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index ac610b7..88f9563 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -741,7 +741,7 @@ typedef struct unw_rec_list {
struct unw_rec_list *next;
} unw_rec_list;
-#define SLOT_NUM_NOT_SET (unsigned)-1
+#define SLOT_NUM_NOT_SET -1UL
/* Linked list of saved prologue counts. A very poor
implementation of a map from label numbers to prologue counts. */
@@ -1045,9 +1045,9 @@ obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
const char *sec_name;
char *sym_name;
char c;
- offsetT size;
- offsetT cur_size;
- offsetT temp;
+ valueT size;
+ valueT cur_size;
+ valueT temp;
symbolS *symbolP;
segT current_seg = now_seg;
subsegT current_subseg = now_subseg;
@@ -1109,7 +1109,7 @@ obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
temp = get_absolute_expression ();
size = temp;
- size &= ((offsetT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1;
+ size &= ((valueT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1;
if (temp != size)
{
as_warn (_("size (%ld) out of range, ignored"), (long) temp);
@@ -1150,7 +1150,7 @@ obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
record_alignment (now_seg, log_align);
cur_size = bfd_section_size (now_seg);
- if ((int) size > cur_size)
+ if (size > cur_size)
{
char *pfrag = frag_var (rs_fill, 1, 1, 0, NULL, size - cur_size, NULL);
*pfrag = 0;
diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c
index 1a31e8e..76ff841 100644
--- a/gas/config/tc-iq2000.c
+++ b/gas/config/tc-iq2000.c
@@ -790,7 +790,7 @@ get_symbol (void)
symbolS *p;
c = get_symbol_name (&name);
- p = (symbolS *) symbol_find_or_make (name);
+ p = symbol_find_or_make (name);
(void) restore_line_pointer (c);
return p;
}
diff --git a/gas/config/tc-kvx.c b/gas/config/tc-kvx.c
index 59e2b29..b4ca25c 100644
--- a/gas/config/tc-kvx.c
+++ b/gas/config/tc-kvx.c
@@ -1021,7 +1021,7 @@ kvx_print_insn (struct kvxopc * op ATTRIBUTE_UNUSED)
/* This is a hack which works because the Bundling is the same for all cores
for now. */
- switch ((int) op->bundling)
+ switch (op->bundling)
{
case Bundling_kv3_v1_ALL:
insn_type = "ALL ";
@@ -1109,7 +1109,7 @@ kvx_reorder_bundle (struct kvxinsn *bundle_insn[], int bundle_insncnt)
tag = -1, exu = -1;
/* This is a hack. It works because all the Bundling are the same for all
cores for now. */
- switch ((int) find_bundling (kvxinsn))
+ switch (find_bundling (kvxinsn))
{
case Bundling_kv3_v1_ALL:
if (bundle_insncnt > 1)
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c
index b620d47..7b53b6f 100644
--- a/gas/config/tc-loongarch.c
+++ b/gas/config/tc-loongarch.c
@@ -452,7 +452,7 @@ static hashval_t
align_sec_sym_hash (const void *entry)
{
const align_sec_sym *e = entry;
- return (hashval_t) (e->sec_id);
+ return e->sec_id;
}
static int
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index aa1354f..e5c8f5c 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -7333,7 +7333,7 @@ m68k_set_extension (char const *name, int allow_m, int silent)
if (negated)
not_current_architecture |= (ext->control_regs
- ? *(unsigned *)ext->control_regs: ext->arch);
+ ? *ext->control_regs: ext->arch);
else
current_architecture |= ext->arch;
return 1;
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 5e0eaa2..055d9ee 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -484,7 +484,7 @@ parse_reg (char * s, unsigned * reg)
}
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int) tmpreg >= MIN_PVR_REGNUM && tmpreg <= MAX_PVR_REGNUM)
+ if (tmpreg - MIN_PVR_REGNUM <= MAX_PVR_REGNUM - MIN_PVR_REGNUM)
*reg = REG_PVR + tmpreg;
else
{
@@ -513,7 +513,7 @@ parse_reg (char * s, unsigned * reg)
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int) tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
+ if (tmpreg - MIN_REGNUM <= MAX_REGNUM - MIN_REGNUM)
*reg = tmpreg;
else
{
@@ -550,7 +550,7 @@ parse_reg (char * s, unsigned * reg)
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int)tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
+ if (tmpreg - MIN_REGNUM <= MAX_REGNUM - MIN_REGNUM)
*reg = tmpreg;
else
{
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 8b648ae..9134cef 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1135,8 +1135,7 @@ static bool mips_ignore_branch_isa;
but it's not clear that it would actually improve performance. */
#define RELAX_BRANCH_ENCODE(at, pic, \
uncond, likely, link, toofar) \
- ((relax_substateT) \
- (0xc0000000 \
+ ((0xc0000000 \
| ((at) & 0x1f) \
| ((pic) ? 0x20 : 0) \
| ((toofar) ? 0x40 : 0) \
@@ -16227,7 +16226,7 @@ get_symbol (void)
symbolS *p;
c = get_symbol_name (&name);
- p = (symbolS *) symbol_find_or_make (name);
+ p = symbol_find_or_make (name);
(void) restore_line_pointer (c);
return p;
}
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index 5ae158d..88b7bc4 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -2489,8 +2489,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment)
case BFD_RELOC_MMIX_PUSHJ_STUBBABLE:
/* If this fixup is out of range, punt to the linker to emit an
error. This should only happen with -no-expand. */
- if (val < -(((offsetT) 1 << 19)/2)
- || val >= ((offsetT) 1 << 19)/2 - 1
+ if (val < -((1 << 19) / 2)
+ || val >= (1 << 19) / 2 - 1
|| (val & 3) != 0)
{
if (warn_on_expansion)
@@ -2513,8 +2513,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment)
case BFD_RELOC_MMIX_JMP:
/* If this fixup is out of range, punt to the linker to emit an
error. This should only happen with -no-expand. */
- if (val < -(((offsetT) 1 << 27)/2)
- || val >= ((offsetT) 1 << 27)/2 - 1
+ if (val < -((1 << 27) / 2)
+ || val >= (1 << 27) / 2 - 1
|| (val & 3) != 0)
{
if (warn_on_expansion)
@@ -2773,7 +2773,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
&& (bfd_vma) val + 256 > lowest_data_loc
&& bfd_is_abs_section (addsec))
{
- val -= (offsetT) lowest_data_loc;
+ val -= lowest_data_loc;
addsy = section_symbol (data_section);
}
/* Likewise text section. */
@@ -2781,7 +2781,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
&& (bfd_vma) val + 256 > lowest_text_loc
&& bfd_is_abs_section (addsec))
{
- val -= (offsetT) lowest_text_loc;
+ val -= lowest_text_loc;
addsy = section_symbol (text_section);
}
}
@@ -3437,9 +3437,8 @@ mmix_md_relax_frag (segT seg, fragS *fragP, long stretch)
if (fragP == seginfo->tc_segment_info_data.last_stubfrag)
seginfo->tc_segment_info_data.nstubs = 0;
- return
- (mmix_relax_table[fragP->fr_subtype].rlx_length
- - mmix_relax_table[prev_type].rlx_length);
+ return (mmix_relax_table[fragP->fr_subtype].rlx_length
+ - mmix_relax_table[prev_type].rlx_length);
}
case ENCODE_RELAX (STATE_PUSHJ, STATE_MAX):
@@ -3634,7 +3633,7 @@ mmix_md_finish (void)
if (! merge_gregs)
continue;
- osymval = (offsetT) S_GET_VALUE (symbolP);
+ osymval = S_GET_VALUE (symbolP);
osymfrag = symbol_get_frag (symbolP);
/* If the symbol isn't defined, we can't say that another symbol
@@ -3725,7 +3724,7 @@ mmix_frob_file (void)
}
sym = fixP->fx_addsy;
- offs = (offsetT) fixP->fx_offset;
+ offs = fixP->fx_offset;
/* If the symbol is defined, then it must be resolved to a section
symbol at this time, or else we don't know how to handle it. */
@@ -3748,7 +3747,7 @@ mmix_frob_file (void)
&& (bfd_vma) offs + 256 > lowest_data_loc
&& bfd_is_abs_section (S_GET_SEGMENT (sym)))
{
- offs -= (offsetT) lowest_data_loc;
+ offs -= lowest_data_loc;
sym = section_symbol (data_section);
}
/* Likewise text section. */
@@ -3756,7 +3755,7 @@ mmix_frob_file (void)
&& (bfd_vma) offs + 256 > lowest_text_loc
&& bfd_is_abs_section (S_GET_SEGMENT (sym)))
{
- offs -= (offsetT) lowest_text_loc;
+ offs -= lowest_text_loc;
sym = section_symbol (text_section);
}
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index f57540e..210e9b0 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -828,8 +828,7 @@ mn10200_insert_operand (unsigned long *insnp,
if (operand->bits < 24
&& (operand->flags & MN10200_OPERAND_NOCHECK) == 0)
{
- long min, max;
- offsetT test;
+ offsetT min, max;
if ((operand->flags & MN10200_OPERAND_SIGNED) != 0)
{
@@ -842,11 +841,8 @@ mn10200_insert_operand (unsigned long *insnp,
min = 0;
}
- test = val;
-
- if (test < min || test > max)
- as_warn_value_out_of_range (_("operand"), test, (offsetT) min,
- (offsetT) max, file, line);
+ if (val < min || val > max)
+ as_warn_value_out_of_range (_("operand"), val, min, max, file, line);
}
if ((operand->flags & MN10200_OPERAND_EXTENDED) == 0)
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 537c2cb..a1d89f0 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1103,7 +1103,7 @@ check_operand (const struct mn10300_operand *operand,
test = val;
- if (test < (offsetT) min || test > (offsetT) max)
+ if (test < min || test > max)
return false;
}
return true;
@@ -1146,8 +1146,9 @@ mn10300_insert_operand (unsigned long *insnp,
test = val;
- if (test < (offsetT) min || test > (offsetT) max)
- as_warn_value_out_of_range (_("operand"), test, (offsetT) min, (offsetT) max, file, line);
+ if (test < min || test > max)
+ as_warn_value_out_of_range (_("operand"), test, (offsetT) min,
+ (offsetT) max, file, line);
}
if ((operand->flags & MN10300_OPERAND_SPLIT) != 0)
@@ -1209,20 +1210,20 @@ mn10300_insert_operand (unsigned long *insnp,
}
else if ((operand->flags & MN10300_OPERAND_EXTENDED) == 0)
{
- *insnp |= (((long) val & ((1 << operand->bits) - 1))
+ *insnp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift));
if ((operand->flags & MN10300_OPERAND_REPEATED) != 0)
- *insnp |= (((long) val & ((1 << operand->bits) - 1))
+ *insnp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift + operand->bits));
}
else
{
- *extensionp |= (((long) val & ((1 << operand->bits) - 1))
+ *extensionp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift));
if ((operand->flags & MN10300_OPERAND_REPEATED) != 0)
- *extensionp |= (((long) val & ((1 << operand->bits) - 1))
+ *extensionp |= ((val & ((1 << operand->bits) - 1))
<< (operand->shift + shift + operand->bits));
}
}
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index f5c021d..647744f 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -3896,7 +3896,7 @@ nds32_adjust_label (int n)
/* Only frag by alignment when needed.
Otherwise, it will fail to optimize labels on 4-byte boundary. (bug8454)
See md_convert_frag () and RELAX_SET_RELAXABLE (frag) for details. */
- if (frag_now_fix () & ((1 << n) -1 ))
+ if (frag_now_fix () & (((addressT) 1 << n) - 1))
{
if (subseg_text_p (now_seg))
{
@@ -3921,7 +3921,7 @@ nds32_adjust_label (int n)
old_frag = symbol_get_frag (label);
old_value = S_GET_VALUE (label);
- new_value = (valueT) frag_now_fix ();
+ new_value = frag_now_fix ();
/* Multiple labels may be on the same address. And the last symbol
may not be a label at all, e.g., register name, external function names,
@@ -4208,8 +4208,6 @@ struct relax_hint_id *record_id_head = NULL;
/* Is the buffer large enough? */
#define MAX_BUFFER 12
-static char *nds_itoa (int n);
-
static char *
nds_itoa (int n)
{
diff --git a/gas/config/tc-pru.c b/gas/config/tc-pru.c
index 9e12ab6..dcc23ba 100644
--- a/gas/config/tc-pru.c
+++ b/gas/config/tc-pru.c
@@ -255,7 +255,7 @@ pru_align (int log_size, const char *pfill, symbolS *label)
old_frag = symbol_get_frag (label);
old_value = S_GET_VALUE (label);
- new_value = (valueT) frag_now_fix ();
+ new_value = frag_now_fix ();
/* It is possible to have more than one label at a particular
address, especially if debugging is enabled, so we must
@@ -949,7 +949,7 @@ pru_assemble_expression (const char *exprstr,
if (pru_mode == PRU_MODE_TEST && ep->X_op == O_constant)
value = ep->X_add_number;
- return (unsigned long) value;
+ return value;
}
/* Try to parse a non-relocatable expression. */
@@ -1100,7 +1100,6 @@ pru_assemble_arg_b (pru_insn_infoS *insn_info, const char *argstr)
SET_INSN_FIELD (RS2, insn_info->insn_code, src2->index);
SET_INSN_FIELD (RS2SEL, insn_info->insn_code, src2->regsel);
}
-
}
static void
@@ -1554,7 +1553,6 @@ md_show_usage (FILE *stream)
" -mlink-relax generate relocations for linker relaxation (default).\n"
" -mno-link-relax don't generate relocations for linker relaxation.\n"
));
-
}
/* This function is called once, at assembler startup time.
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 0492311..f0b119f 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -4322,12 +4322,12 @@ riscv_ip_hardcode (char *str,
switch (imm_expr->X_op)
{
case O_constant:
- values[num++] = (insn_t) imm_expr->X_add_number;
+ values[num++] = imm_expr->X_add_number;
break;
case O_big:
/* Extract lower 32-bits of a big number.
Assume that generic_bignum_to_int32 work on such number. */
- values[num++] = (insn_t) generic_bignum_to_int32 ();
+ values[num++] = generic_bignum_to_int32 ();
break;
default:
/* The first value isn't constant, so it should be
@@ -4616,7 +4616,7 @@ bool riscv_parse_name (const char *name, struct expressionS *ep,
gas_assert (mode == expr_normal);
regno = reg_lookup_internal (name, RCLASS_GPR);
- if (regno == (unsigned int)-1)
+ if (regno == -1u)
return false;
if (symbol_find (name) != NULL)
diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c
index 438418a..5110470 100644
--- a/gas/config/tc-s12z.c
+++ b/gas/config/tc-s12z.c
@@ -579,9 +579,7 @@ lex_opr (uint8_t *buffer, int *n_bytes, expressionS *exp,
}
else if (lex_reg_name (REG_BIT_Dn, &reg2))
{
- if (c >= -1 * (long) (0x1u << 17)
- &&
- c < (long) (0x1u << 17) - 1)
+ if (c >= -1 * (1L << 17) && c < (1L << 17) - 1)
{
*n_bytes = 3;
*xb = 0x80;
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 6d4748e..d5d3976 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -727,9 +727,9 @@ s390_insert_operand (unsigned char *insn,
{
if (operand->flags & S390_OPERAND_PCREL)
{
- val = (offsetT) ((addressT) val << 1);
- min = (offsetT) ((addressT) min << 1);
- max = (offsetT) ((addressT) max << 1);
+ val = (addressT) val << 1;
+ min = (addressT) min << 1;
+ max = (addressT) max << 1;
}
s390_bad_operand_out_of_range (operand_number, val, min, max,
@@ -738,7 +738,7 @@ s390_insert_operand (unsigned char *insn,
return;
}
/* val is ok, now restrict it to operand->bits bits. */
- uval = (addressT) val & ((((addressT) 1 << (operand->bits-1)) << 1) - 1);
+ uval = val & ((((addressT) 1 << (operand->bits-1)) << 1) - 1);
/* val is restrict, now check for special case. */
if (operand->bits == 20 && operand->shift == 20)
uval = (uval >> 12) | ((uval & 0xfff) << 8);
@@ -748,8 +748,8 @@ s390_insert_operand (unsigned char *insn,
addressT min, max;
max = (((addressT) 1 << (operand->bits - 1)) << 1) - 1;
- min = (offsetT) 0;
- uval = (addressT) val;
+ min = 0;
+ uval = val;
/* Vector register operands have an additional bit in the RXB
field. */
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index cf8687bb..f3f1b2a 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -1507,7 +1507,7 @@ s3_data_op2 (char **str, int shift, enum score_data_type data_type)
sprintf (s3_err_msg,
_("invalid constant: %d bit expression not in range %u..%u"),
s3_score_df_range[data_type].bits,
- 0, (unsigned)0xffffffff);
+ 0, 0xffffffff);
}
else if (data_type == _IMM5_MULTI_LOAD)
{
@@ -4124,7 +4124,7 @@ s3_build_la_pic (int reg_rd, expressionS exp)
var_num = 1;
/* Fix part
For an external symbol: addi rD, <constant> */
- sprintf (tmp, "addi r%d, %d", reg_rd, (int)add_number);
+ sprintf (tmp, "addi r%d, %d", reg_rd, (int) add_number);
if (s3_append_insn (tmp, false) == s3_FAIL)
return;
@@ -4811,13 +4811,15 @@ s3_nopic_need_relax (symbolS * sym, int before_relaxing)
{
return 1;
}
- else if ((!S_IS_DEFINED (sym) || S_IS_COMMON (sym)) && (0
- /* We must defer this decision until after the whole file has been read,
- since there might be a .extern after the first use of this symbol. */
- || (before_relaxing
- && S_GET_VALUE (sym) == 0)
- || (S_GET_VALUE (sym) != 0
- && S_GET_VALUE (sym) <= s3_g_switch_value)))
+ else if ((!S_IS_DEFINED (sym) || S_IS_COMMON (sym))
+ && (0
+ /* We must defer this decision until after the
+ whole file has been read, since there might be a
+ .extern after the first use of this symbol. */
+ || (before_relaxing
+ && S_GET_VALUE (sym) == 0)
+ || (S_GET_VALUE (sym) != 0
+ && S_GET_VALUE (sym) <= s3_g_switch_value)))
{
return 0;
}
@@ -5601,7 +5603,7 @@ s3_get_symbol (void)
symbolS *p;
c = get_symbol_name (&name);
- p = (symbolS *) symbol_find_or_make (name);
+ p = symbol_find_or_make (name);
(void) restore_line_pointer (c);
return p;
}
@@ -6449,7 +6451,7 @@ s3_begin (void)
s3_build_dependency_insn_hsh ();
- for (i = (int)s3_REG_TYPE_FIRST; i < (int)s3_REG_TYPE_MAX; i++)
+ for (i = s3_REG_TYPE_FIRST; i < s3_REG_TYPE_MAX; i++)
s3_build_reg_hsh (s3_all_reg_maps + i);
/* Initialize dependency vector. */
@@ -6767,7 +6769,7 @@ s3_relax_branch_inst16 (fragS * fragp)
if (s == NULL)
frag_addr = 0;
else
- symbol_address = (addressT) symbol_get_frag (s)->fr_address;
+ symbol_address = symbol_get_frag (s)->fr_address;
inst_value = s3_md_chars_to_number (fragp->fr_literal, s3_INSN16_SIZE);
offset = (inst_value & 0x1ff) << 1;
@@ -6810,7 +6812,7 @@ s3_relax_cmpbranch_inst32 (fragS * fragp)
if (s == NULL)
frag_addr = 0;
else
- symbol_address = (addressT) symbol_get_frag (s)->fr_address;
+ symbol_address = symbol_get_frag (s)->fr_address;
inst_value = s3_md_chars_to_number (fragp->fr_literal, s3_INSN_SIZE);
offset = (inst_value & 0x1)
diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c
index 8543718..7b6b685 100644
--- a/gas/config/tc-score7.c
+++ b/gas/config/tc-score7.c
@@ -5251,7 +5251,7 @@ s7_b32_relax_to_b16 (fragS * fragp)
if (s == NULL)
frag_addr = 0;
else
- symbol_address = (addressT) symbol_get_frag (s)->fr_address;
+ symbol_address = symbol_get_frag (s)->fr_address;
value = s7_md_chars_to_number (fragp->fr_literal, s7_INSN_SIZE);
@@ -5440,7 +5440,7 @@ s7_get_symbol (void)
symbolS *p;
c = get_symbol_name (&name);
- p = (symbolS *) symbol_find_or_make (name);
+ p = symbol_find_or_make (name);
(void) restore_line_pointer (c);
return p;
}
@@ -6080,7 +6080,7 @@ s7_begin (void)
s7_build_dependency_insn_hsh ();
- for (i = (int) REG_TYPE_FIRST; i < (int) s7_REG_TYPE_MAX; i++)
+ for (i = REG_TYPE_FIRST; i < s7_REG_TYPE_MAX; i++)
s7_build_reg_hsh (s7_all_reg_maps + i);
/* Initialize dependency vector. */
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 2a25937..5653583 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -3703,8 +3703,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
if (val >= 0)
val >>= shift;
else
- val = ((val >> shift)
- | ((long) -1 & ~ ((long) -1 >> shift)));
+ val = (val >> shift) | (-1L & ~ (-1L >> shift));
}
/* Extend sign for 64-bit host. */
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 61f43e0..0dd9205 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -1254,7 +1254,7 @@ synthetize_setuw (const struct sparc_opcode *insn)
&& (the_insn.exp.X_add_number < -(offsetT) U0x80000000
|| the_insn.exp.X_add_number > (offsetT) U0xffffffff))
as_warn (_("set: number not in -2147483648..4294967295 range"));
- the_insn.exp.X_add_number = (int) the_insn.exp.X_add_number;
+ the_insn.exp.X_add_number = (int32_t) the_insn.exp.X_add_number;
}
}
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
index 323f8bb..2c80f97 100644
--- a/gas/config/tc-tic30.c
+++ b/gas/config/tc-tic30.c
@@ -598,7 +598,7 @@ tic30_operand (char *token)
current_op->immediate.s_number
= current_op->immediate.imm_expr.X_add_number;
current_op->immediate.u_number
- = (unsigned int) current_op->immediate.imm_expr.X_add_number;
+ = current_op->immediate.imm_expr.X_add_number;
current_op->immediate.resolved = 1;
}
}
@@ -610,8 +610,8 @@ tic30_operand (char *token)
current_op->immediate.decimal_found = 1;
current_op->immediate.label = xstrdup (token);
current_op->immediate.f_number = (float) atof (token);
- current_op->immediate.s_number = (int) atoi (token);
- current_op->immediate.u_number = (unsigned int) atoi (token);
+ current_op->immediate.s_number = atoi (token);
+ current_op->immediate.u_number = atoi (token);
current_op->immediate.resolved = 1;
}
current_op->op_type = Disp | Abs24 | Imm16 | Imm24;
@@ -1279,7 +1279,7 @@ md_atof (int what_statement_type,
if (mant == 0)
{
mant |= 0x00800000;
- exp = (long) exp - 0x01000000;
+ exp = exp - 0x01000000;
}
}
tmsfloat = exp | mant;
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index 25efad6..515b843 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -478,7 +478,7 @@ tic54x_bss (int x ATTRIBUTE_UNUSED)
char c;
char *name;
char *p;
- int words;
+ offsetT words;
segT current_seg;
subsegT current_subseg;
symbolS *symbolP;
@@ -504,7 +504,7 @@ tic54x_bss (int x ATTRIBUTE_UNUSED)
words = get_absolute_expression ();
if (words < 0)
{
- as_bad (_(".bss size %d < 0!"), words);
+ as_bad (_(".bss size %d < 0!"), (int) words);
ignore_rest_of_line ();
return;
}
@@ -860,7 +860,7 @@ tic54x_tag (int ignore ATTRIBUTE_UNUSED)
static void
tic54x_struct_field (int type)
{
- int size;
+ unsigned int size;
int count = 1;
int new_bitfield_offset = 0;
int field_align = current_stag->current_bitfield_offset != 0;
@@ -964,12 +964,12 @@ tic54x_struct_field (int type)
if (current_stag->is_union)
{
/* Note we treat the element as if it were an array of COUNT. */
- if (current_stag->size < (unsigned) size * count)
+ if (current_stag->size < size * count)
current_stag->size = size * count;
}
else
{
- abs_section_offset += (unsigned) size * count;
+ abs_section_offset += size * count;
current_stag->current_bitfield_offset = new_bitfield_offset;
}
line_label = NULL;
@@ -1831,7 +1831,7 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED)
/* OR in existing value. */
if (alloc_frag->tc_frag_data)
- value |= ((unsigned short) p[1] << 8) | p[0];
+ value |= ((uint16_t) p[1] << 8) | p[0];
md_number_to_chars (p, value, 2);
alloc_frag->tc_frag_data += size;
if (alloc_frag->tc_frag_data == 16)
@@ -3937,16 +3937,14 @@ encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand)
if (strcasecmp (operand->buf, "st0") == 0
|| strcasecmp (operand->buf, "st1") == 0)
{
- insn->opcode[0].word |=
- ((unsigned short) (operand->buf[2] - '0')) << 9;
+ insn->opcode[0].word |= ((uint16_t) (operand->buf[2] - '0')) << 9;
return 1;
}
else if (operand->exp.X_op == O_constant
&& (operand->exp.X_add_number == 0
|| operand->exp.X_add_number == 1))
{
- insn->opcode[0].word |=
- ((unsigned short) (operand->exp.X_add_number)) << 9;
+ insn->opcode[0].word |= ((uint16_t) (operand->exp.X_add_number)) << 9;
return 1;
}
as_bad (_("Invalid status register \"%s\""), operand->buf);
@@ -5269,7 +5267,7 @@ tic54x_relax_frag (fragS *frag, long stretch ATTRIBUTE_UNUSED)
valueT value = bi->value;
value <<= available - size;
- value |= ((unsigned short) p[1] << 8) | p[0];
+ value |= ((uint16_t) p[1] << 8) | p[0];
md_number_to_chars (p, value, 2);
if ((prev_frag->tc_frag_data += size) == 16)
prev_frag->tc_frag_data = 0;
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index 99ec7ec..7862236 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -3525,7 +3525,7 @@ md_assemble (char *str)
bool found_match = false;
for (i = 0; i < TIC6X_NUM_PREFER; i++)
- opc_rank[i] = (unsigned int) -1;
+ opc_rank[i] = -1u;
min_rank = TIC6X_NUM_PREFER - 1;
max_rank = 0;
@@ -3574,7 +3574,7 @@ md_assemble (char *str)
if (rank > max_rank)
max_rank = rank;
- if (opc_rank[rank] == (unsigned int) -1)
+ if (opc_rank[rank] == -1u)
opc_rank[rank] = i;
else
/* The opcode table should provide a total ordering
@@ -3605,7 +3605,7 @@ md_assemble (char *str)
{
fix_needed = false;
- if (opc_rank[try_rank] == (unsigned int) -1)
+ if (opc_rank[try_rank] == -1u)
continue;
opcode_value = tic6x_try_encode (opcm[opc_rank[try_rank]], operands,
@@ -4466,7 +4466,7 @@ tic6x_pcrel_from_section (fixS *fixp, segT sec)
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| S_GET_SEGMENT (fixp->fx_addsy) != sec))
return 0;
- return (fixp->fx_where + fixp->fx_frag->fr_address) & ~(long) 0x1f;
+ return (fixp->fx_where + fixp->fx_frag->fr_address) & ~0x1fULL;
}
/* Round up a section size to the appropriate boundary. */
diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index 853e940..84daf05 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -441,25 +441,25 @@ apply_special_operator (operatorT op, offsetT num, const char *file,
check_shift = 0;
/* Fall through. */
case O_hw0:
- ret = (signed short)num;
+ ret = (int16_t) num;
break;
case O_hw1_last:
check_shift = 16;
/* Fall through. */
case O_hw1:
- ret = (signed short)(num >> 16);
+ ret = (int16_t) (num >> 16);
break;
case O_hw2_last:
check_shift = 32;
/* Fall through. */
case O_hw2:
- ret = (signed short)(num >> 32);
+ ret = (int16_t) (num >> 32);
break;
case O_hw3:
- ret = (signed short)(num >> 48);
+ ret = (int16_t) (num >> 48);
break;
default:
@@ -959,10 +959,8 @@ tilegx_flush_bundle (void)
/* Figure out what pipe the fnop must be in via arithmetic.
* p0 + p1 + p2 must sum to the sum of TILEGX_PIPELINE_Y[012]. */
current_bundle[0].pipe =
- (tilegx_pipeline)((TILEGX_PIPELINE_Y0
- + TILEGX_PIPELINE_Y1
- + TILEGX_PIPELINE_Y2) -
- (current_bundle[1].pipe + current_bundle[2].pipe));
+ (TILEGX_PIPELINE_Y0 + TILEGX_PIPELINE_Y1 + TILEGX_PIPELINE_Y2
+ - current_bundle[1].pipe - current_bundle[2].pipe);
}
check_illegal_reg_writes ();
diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c
index 4481731..8c90217 100644
--- a/gas/config/tc-tilepro.c
+++ b/gas/config/tc-tilepro.c
@@ -387,13 +387,13 @@ apply_special_operator (operatorT op, int num)
switch (op)
{
case O_lo16:
- return (signed short)num;
+ return (int16_t) num;
case O_hi16:
- return (signed short)(num >> 16);
+ return (int16_t) (num >> 16);
case O_ha16:
- return (signed short)((num + 0x8000) >> 16);
+ return (int16_t) ((num + 0x8000) >> 16);
default:
abort ();
@@ -846,10 +846,8 @@ tilepro_flush_bundle (void)
/* Figure out what pipe the fnop must be in via arithmetic.
* p0 + p1 + p2 must sum to the sum of TILEPRO_PIPELINE_Y[012]. */
current_bundle[0].pipe =
- (tilepro_pipeline)((TILEPRO_PIPELINE_Y0
- + TILEPRO_PIPELINE_Y1
- + TILEPRO_PIPELINE_Y2) -
- (current_bundle[1].pipe + current_bundle[2].pipe));
+ (TILEPRO_PIPELINE_Y0 + TILEPRO_PIPELINE_Y1 + TILEPRO_PIPELINE_Y2
+ - current_bundle[1].pipe - current_bundle[2].pipe);
}
check_illegal_reg_writes ();
diff --git a/gas/config/tc-visium.c b/gas/config/tc-visium.c
index 1e3e3a8..01767f3 100644
--- a/gas/config/tc-visium.c
+++ b/gas/config/tc-visium.c
@@ -412,10 +412,9 @@ relaxed_symbol_addr (fragS *fragp, long stretch)
if (f->fr_type == rs_align || f->fr_type == rs_align_code)
{
if (stretch < 0)
- stretch = - ((- stretch)
- & ~ ((1 << (int) f->fr_offset) - 1));
+ stretch = -(-stretch & ~((1ul << f->fr_offset) - 1));
else
- stretch &= ~ ((1 << (int) f->fr_offset) - 1);
+ stretch &= ~((1ul << f->fr_offset) - 1);
if (stretch == 0)
break;
}
@@ -683,7 +682,7 @@ md_apply_fix (fixS * fixP, valueT * value, segT segment)
default:
as_bad_where (fixP->fx_file, fixP->fx_line,
"bad or unhandled relocation type: 0x%02x",
- fixP->fx_r_type);
+ (unsigned int) fixP->fx_r_type);
break;
}
@@ -1373,9 +1372,8 @@ md_assemble (char *str0)
if (imm < 0 || imm > 31)
as_bad ("immediate value out of range");
- opcode |=
- (r1 << 10) | (r2 << 16) | (1 << 9) | ((imm & 0x1f) <<
- 4);
+ opcode |= ((r1 << 10) | (r2 << 16) | (1 << 9)
+ | ((imm & 0x1f) << 4));
}
else
{
@@ -1889,9 +1887,8 @@ md_assemble (char *str0)
if (finst < 0 || finst > 15)
as_bad ("finst out of range");
- opcode |=
- ((finst & 0xf) << 27) | (r1 << 10) | (r2 << 16) | (r3 <<
- 4);
+ opcode |= (((finst & 0xf) << 27)
+ | (r1 << 10) | (r2 << 16) | (r3 << 4));
}
else
{
@@ -1955,9 +1952,8 @@ md_assemble (char *str0)
if (finst < 0 || finst > 15)
as_bad ("finst out of range");
- opcode |=
- ((finst & 0xf) << 27) | (r1 << 10) | (r2 << 16) | (r3 <<
- 4);
+ opcode |= (((finst & 0xf) << 27)
+ | (r1 << 10) | (r2 << 16) | (r3 << 4));
}
else
{
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 38af6d0..af1154e 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -1869,7 +1869,7 @@ expression_end (const char *name)
}
-#define ERROR_REG_NUM ((unsigned) -1)
+#define ERROR_REG_NUM (-1u)
static unsigned
tc_get_register (const char *prefix)
@@ -1961,7 +1961,7 @@ expression_maybe_register (xtensa_opcode opc, int opnd, expressionS *tok)
case BFD_RELOC_HI16:
if (tok->X_op == O_constant)
{
- tok->X_add_number = ((unsigned) tok->X_add_number) >> 16;
+ tok->X_add_number = ((uint32_t) tok->X_add_number) >> 16;
return;
}
break;
diff --git a/gas/debug.c b/gas/debug.c
index 794dc4c..9fe9a30 100644
--- a/gas/debug.c
+++ b/gas/debug.c
@@ -22,7 +22,8 @@
#include "as.h"
#include "subsegs.h"
-dmp_frags ()
+void
+dmp_frags (void)
{
asection *s;
frchainS *chp;
@@ -48,9 +49,8 @@ dmp_frags ()
}
}
-dmp_frag (fp, indent)
- struct frag *fp;
- char *indent;
+void
+dmp_frag (struct frag *fp, char *indent)
{
for (; fp; fp = fp->fr_next)
{
@@ -90,9 +90,8 @@ dmp_frag (fp, indent)
}
}
-var_chars (fp, n)
- struct frag *fp;
- int n;
+void
+var_chars (struct frag *fp, int n)
{
unsigned char *p;
diff --git a/gas/ecoff.c b/gas/ecoff.c
index ba8f6d8..7411595 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -3669,9 +3669,8 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
else if (l->next->frag->fr_address + l->next->paddr
> l->frag->fr_address + l->paddr)
{
- count = ((l->next->frag->fr_address + l->next->paddr
- - (l->frag->fr_address + l->paddr))
- >> 2);
+ count = (l->next->frag->fr_address + l->next->paddr
+ - (l->frag->fr_address + l->paddr)) >> 2;
}
else
{
@@ -3785,7 +3784,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
while (count > 0)
{
if (bufptr >= *bufend)
- bufptr = ecoff_add_bytes (buf, bufend, bufptr, (long) 1);
+ bufptr = ecoff_add_bytes (buf, bufend, bufptr, 1);
/* 1 is added to each count read. */
--count;
if (count > 0x0f)
diff --git a/gas/ehopt.c b/gas/ehopt.c
index 8852820..5a9d9d6 100644
--- a/gas/ehopt.c
+++ b/gas/ehopt.c
@@ -537,7 +537,7 @@ eh_frame_convert_frag (fragS *frag)
int loc4_fix, ca;
loc4_frag = (fragS *) frag->fr_opcode;
- loc4_fix = (int) frag->fr_offset;
+ loc4_fix = frag->fr_offset;
diff = resolve_symbol_value (frag->fr_symbol);
diff --git a/gas/expr.c b/gas/expr.c
index 06283c2..aaad288 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1991,8 +1991,8 @@ expr (int rankarg, /* Larger # is higher rank. */
symbol_get_frag (right.X_add_symbol),
&frag_off))
{
- offsetT symval_diff = S_GET_VALUE (resultP->X_add_symbol)
- - S_GET_VALUE (right.X_add_symbol);
+ offsetT symval_diff = (S_GET_VALUE (resultP->X_add_symbol)
+ - S_GET_VALUE (right.X_add_symbol));
subtract_from_result (resultP, right.X_add_number, right.X_extrabit);
subtract_from_result (resultP, frag_off / OCTETS_PER_BYTE, 0);
add_to_result (resultP, symval_diff, symval_diff < 0);
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index 7e29f84..3cba508 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -21,7 +21,7 @@
#include "as.h"
#include "subsegs.h"
#include "sframe.h"
-#include "sframe-api.h"
+#include "sframe-internal.h"
#include "gen-sframe.h"
#include "dw2gencfi.h"
@@ -685,8 +685,8 @@ output_sframe_internal (void)
out_one (SFRAME_VERSION);
/* gas must ensure emitted SFrame sections have at least the required flags
set. */
- gas_assert ((sframe_flags & SFRAME_F_LD_MUSTHAVE_FLAGS)
- == SFRAME_F_LD_MUSTHAVE_FLAGS);
+ gas_assert ((sframe_flags & SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS)
+ == SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS);
out_one (sframe_flags);
/* abi/arch. */
#ifdef sframe_get_abi_arch
diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index 93d1e8e..c967a39 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -419,8 +419,8 @@ input_scrub_next_buffer (char **bufp)
partial_size = limit - p;
/* Save the fragment after that last newline. */
- memcpy (save_source, partial_where, (int) AFTER_SIZE);
- memcpy (partial_where, AFTER_STRING, (int) AFTER_SIZE);
+ memcpy (save_source, partial_where, AFTER_SIZE);
+ memcpy (partial_where, AFTER_STRING, AFTER_SIZE);
return partial_where;
read_more:
diff --git a/gas/listing.c b/gas/listing.c
index dbf4782..92c560c 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -795,7 +795,7 @@ calc_hex (list_info_type *list)
{
size_t data_buffer_size;
list_info_type *first = list;
- unsigned int address = ~(unsigned int) 0;
+ unsigned int address = ~0u;
fragS *frag;
fragS *frag_ptr;
unsigned int octet_in_frag;
@@ -817,7 +817,7 @@ calc_hex (list_info_type *list)
while (octet_in_frag < frag_ptr->fr_fix
&& data_buffer_size < MAX_BYTES - 3)
{
- if (address == ~(unsigned int) 0)
+ if (address == ~0u)
address = frag_ptr->fr_address / OCTETS_PER_BYTE;
sprintf (data_buffer + data_buffer_size,
@@ -836,7 +836,7 @@ calc_hex (list_info_type *list)
< frag_ptr->fr_fix + frag_ptr->fr_var * frag_ptr->fr_offset)
&& data_buffer_size < MAX_BYTES - 3)
{
- if (address == ~(unsigned int) 0)
+ if (address == ~0u)
address = frag_ptr->fr_address / OCTETS_PER_BYTE;
sprintf (data_buffer + data_buffer_size,
@@ -875,7 +875,7 @@ print_lines (list_info_type *list, unsigned int lineno,
nchars = (LISTING_WORD_SIZE * 2 + 1) * listing_lhs_width;
/* Print the hex for the first line. */
- if (address == ~(unsigned int) 0)
+ if (address == ~0u)
{
fprintf (list_file, "% 4d ", lineno);
for (idx = 0; idx < nchars; idx++)
@@ -1302,7 +1302,7 @@ listing_listing (char *name ATTRIBUTE_UNUSED)
p = buffer_line (list->file, buffer, width);
if (list->file->linenum < list_line)
- address = ~(unsigned int) 0;
+ address = ~0u;
else
address = calc_hex (list);
@@ -1354,11 +1354,11 @@ print_timestamp (void)
}
static void
-print_single_option (char * opt, int *pos)
+print_single_option (char *opt, size_t *pos)
{
size_t opt_len = strlen (opt);
- if ((*pos + opt_len) < paper_width)
+ if (*pos + opt_len < paper_width)
{
fprintf (list_file, _("%s "), opt);
*pos = *pos + opt_len;
@@ -1376,7 +1376,7 @@ static void
print_options (char ** argv)
{
const char *field_name = _("\n options passed\t: ");
- int pos = strlen (field_name);
+ size_t pos = strlen (field_name);
char **p;
fputs (field_name, list_file);
diff --git a/gas/read.c b/gas/read.c
index e01d639..d604d95 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -3174,7 +3174,7 @@ s_rept (int expand_count)
{
size_t count;
- count = (size_t) get_absolute_expression ();
+ count = get_absolute_expression ();
do_repeat (count, "REPT", "ENDR", expand_count ? "" : NULL);
}
@@ -4636,7 +4636,7 @@ emit_expr_with_reloc (expressionS *exp,
/* We can ignore any carry out, because it will be handled by
extra_digit if it is needed. */
- extra_digit = (valueT) -1;
+ extra_digit = -1;
op = O_big;
}
@@ -5453,7 +5453,7 @@ emit_leb128_expr (expressionS *exp, int sign)
/* Let check_eh_frame know that data is being emitted. nbytes == -1 is
a signal that this is leb128 data. It shouldn't optimize this away. */
- nbytes = (unsigned int) -1;
+ nbytes = -1u;
if (check_eh_frame (exp, &nbytes))
abort ();
@@ -6293,7 +6293,7 @@ char /* Return terminator. */
get_absolute_expression_and_terminator (long *val_pointer /* Return value of expression. */)
{
/* FIXME: val_pointer should probably be offsetT *. */
- *val_pointer = (long) get_absolute_expression ();
+ *val_pointer = get_absolute_expression ();
return (*input_line_pointer++);
}
@@ -6357,7 +6357,7 @@ demand_copy_string (int *lenP)
ignore_rest_of_line ();
}
*lenP = len;
- return (retval);
+ return retval;
}
/* In: Input_line_pointer->next character.
diff --git a/gas/symbols.c b/gas/symbols.c
index 5d6d141..275d056 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -746,7 +746,7 @@ symbol_find_or_make (const char *name)
symbol_table_insert (symbolP);
} /* if symbol wasn't found */
- return (symbolP);
+ return symbolP;
}
symbolS *
@@ -760,7 +760,7 @@ symbol_make (const char *name)
if (!symbolP)
symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0);
- return (symbolP);
+ return symbolP;
}
symbolS *
@@ -2241,7 +2241,7 @@ S_GET_VALUE_WHERE (symbolS *s, const char * file, unsigned int line)
S_GET_NAME (s));
}
}
- return (valueT) s->x->value.X_add_number;
+ return s->x->value.X_add_number;
}
valueT
diff --git a/gas/write.c b/gas/write.c
index ca6fedf..455dc44 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -587,8 +587,8 @@ size_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx ATTRIBUTE_UNUSED)
size = 0;
flags = bfd_section_flags (sec);
- if (size == 0 && bfd_section_size (sec) != 0 &&
- (flags & SEC_HAS_CONTENTS) != 0)
+ if (size == 0 && bfd_section_size (sec) != 0
+ && (flags & SEC_HAS_CONTENTS) != 0)
return;
if (size > 0 && ! seginfo->bss)
diff --git a/include/sframe-api.h b/include/sframe-api.h
index 753a91f..3dc18b6 100644
--- a/include/sframe-api.h
+++ b/include/sframe-api.h
@@ -36,11 +36,6 @@ typedef struct sframe_encoder_ctx sframe_encoder_ctx;
#define MAX_OFFSET_BYTES \
((SFRAME_FRE_OFFSET_4B * 2 * MAX_NUM_STACK_OFFSETS))
-/* Set of flags that are required to be harmonious between all decoder and
- encoder objects participating in a link. */
-#define SFRAME_F_LD_MUSTHAVE_FLAGS \
- (SFRAME_F_FDE_FUNC_START_PCREL)
-
/* User interfacing SFrame Row Entry.
An abstraction provided by libsframe so the consumer is decoupled from
the binary format representation of the same.
diff --git a/include/sframe-internal.h b/include/sframe-internal.h
new file mode 100644
index 0000000..a246f26
--- /dev/null
+++ b/include/sframe-internal.h
@@ -0,0 +1,30 @@
+/* Internal header for SFrame.
+
+ Used by GNU as and ld.
+
+ Copyright (C) 2025 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _SFRAME_INTERNAL_H
+#define _SFRAME_INTERNAL_H
+
+#include "sframe.h"
+
+/* Set of flags which are required to be harmonious between GNU as and ld. All
+ objects participating in the link for GNU ld must have these flags set. */
+#define SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS \
+ (SFRAME_F_FDE_FUNC_START_PCREL)
+
+#endif /* _SFRAME_INTERNAL_H */
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 32e6e7a..cd1825b 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2874,7 +2874,7 @@ lang_add_section (lang_statement_list_type *ptr,
/* This must happen after flags have been updated. The output
section may have been created before we saw its first input
section, eg. for a data statement. */
- bfd_init_private_section_data (section->owner, section,
+ bfd_copy_private_section_data (section->owner, section,
link_info.output_bfd,
output->bfd_section,
&link_info);
@@ -10494,7 +10494,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *p)
/* Allow the BFD backend to copy any private data it understands
from the input section to the output section. */
- if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection))
+ if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection, NULL))
{
err = _("failed to copy private data");
goto loser;
diff --git a/ld/ldwrite.c b/ld/ldwrite.c
index 7613def..974245f 100644
--- a/ld/ldwrite.c
+++ b/ld/ldwrite.c
@@ -366,7 +366,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
n->reloc_count = 0;
n->alignment_power = s->alignment_power;
- bfd_copy_private_section_data (abfd, s, abfd, n);
+ bfd_copy_private_section_data (abfd, s, abfd, n, NULL);
return n;
}