From a9dc948127c2cb5127cec5ca87dbc19f17dd16cf Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 18 Jul 2008 20:49:12 +0000 Subject: [PATCH] bfd: * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter. * bfd-in2.h: Regenerate. * elf32-arm.c (struct elf_arm_obj_tdata): Add field no_wchar_size_warning. (bfd_elf32_arm_set_target_relocs): Add new parameter no_wchar_warn. (elf32_arm_merge_eabi_attributes): Give a warning, not an error, for conflicting wchar_t attributes. Do not warn if --no-wchar-size-warning. Make diagnostic text more specific. ld: * ld.texinfo (--no-wchar-size-warning): Document new ARM option. * emultempl/armelf.em (no_wchar_size_warning): New. (arm_elf_create_output_section_statements): Pass no_wchar_size_warning to arm_elf_create_output_section_statements. (OPTION_NO_WCHAR_SIZE_WARNING): New. (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning. (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning. (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning. ld/testsuite: * ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s, ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d, ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d, ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d, ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d, ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d, ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d, ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d, ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d, ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d, ld-arm/attr-merge-wchar-44.d: New. * ld-arm/arm-elf.exp: Run new tests. --- bfd/ChangeLog | 12 ++++++++++++ bfd/bfd-in.h | 2 +- bfd/bfd-in2.h | 2 +- bfd/elf32-arm.c | 16 +++++++++++----- ld/ChangeLog | 11 +++++++++++ ld/emultempl/armelf.em | 10 ++++++++++ ld/ld.texinfo | 8 ++++++++ ld/testsuite/ChangeLog | 15 +++++++++++++++ ld/testsuite/ld-arm/arm-elf.exp | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-0.s | 11 +++++++++++ .../ld-arm/attr-merge-wchar-00-nowarn.d | 17 +++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-00.d | 17 +++++++++++++++++ .../ld-arm/attr-merge-wchar-02-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-02.d | 18 ++++++++++++++++++ .../ld-arm/attr-merge-wchar-04-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-04.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-2.s | 11 +++++++++++ .../ld-arm/attr-merge-wchar-20-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-20.d | 18 ++++++++++++++++++ .../ld-arm/attr-merge-wchar-22-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-22.d | 18 ++++++++++++++++++ .../ld-arm/attr-merge-wchar-24-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-24.d | 5 +++++ ld/testsuite/ld-arm/attr-merge-wchar-4.s | 11 +++++++++++ .../ld-arm/attr-merge-wchar-40-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-40.d | 18 ++++++++++++++++++ .../ld-arm/attr-merge-wchar-42-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-42.d | 5 +++++ .../ld-arm/attr-merge-wchar-44-nowarn.d | 18 ++++++++++++++++++ ld/testsuite/ld-arm/attr-merge-wchar-44.d | 18 ++++++++++++++++++ 30 files changed, 416 insertions(+), 7 deletions(-) create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-0.s create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-00-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-00.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-02-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-02.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-04-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-04.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-2.s create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-20-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-20.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-22-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-22.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-24-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-24.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-4.s create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-40-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-40.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-42-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-42.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-44-nowarn.d create mode 100644 ld/testsuite/ld-arm/attr-merge-wchar-44.d diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4a676b1910b..fd30fd39f74 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,15 @@ +2008-07-18 Joseph Myers + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter. + * bfd-in2.h: Regenerate. + * elf32-arm.c (struct elf_arm_obj_tdata): Add field + no_wchar_size_warning. + (bfd_elf32_arm_set_target_relocs): Add new parameter + no_wchar_warn. + (elf32_arm_merge_eabi_attributes): Give a warning, not an error, + for conflicting wchar_t attributes. Do not warn if + --no-wchar-size-warning. Make diagnostic text more specific. + 2008-07-18 H.J. Lu PR ld/6748 diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 3a3fa3f934f..21f4f4c788c 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -860,7 +860,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation void bfd_elf32_arm_set_target_relocs (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int); + int, int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index c1ad8c79613..087eff89036 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -867,7 +867,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation void bfd_elf32_arm_set_target_relocs (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int); + int, int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8fbaa35411c..8fc1542e8ae 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -2167,6 +2167,9 @@ struct elf_arm_obj_tdata /* Zero to warn when linking objects with incompatible enum sizes. */ int no_enum_size_warning; + + /* Zero to warn when linking objects with incompatible wchar_t sizes. */ + int no_wchar_size_warning; }; #define elf_arm_tdata(bfd) \ @@ -5271,7 +5274,8 @@ bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd, int fix_v4bx, int use_blx, bfd_arm_vfp11_fix vfp11_fix, - int no_enum_warn, int pic_veneer) + int no_enum_warn, int no_wchar_warn, + int pic_veneer) { struct elf32_arm_link_hash_table *globals; @@ -5296,6 +5300,7 @@ bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd, BFD_ASSERT (is_arm_elf (output_bfd)); elf_arm_tdata (output_bfd)->no_enum_size_warning = no_enum_warn; + elf_arm_tdata (output_bfd)->no_wchar_size_warning = no_wchar_warn; } /* Replace the target offset of a Thumb bl or b.w instruction. */ @@ -8315,13 +8320,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) out_attr[i].i = in_attr[i].i; break; case Tag_ABI_PCS_wchar_t: - if (out_attr[i].i && in_attr[i].i && out_attr[i].i != in_attr[i].i) + if (out_attr[i].i && in_attr[i].i && out_attr[i].i != in_attr[i].i + && !elf_arm_tdata (obfd)->no_wchar_size_warning) { _bfd_error_handler - (_("ERROR: %B: Conflicting definitions of wchar_t"), ibfd); - return FALSE; + (_("warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"), + ibfd, in_attr[i].i, out_attr[i].i); } - if (in_attr[i].i) + else if (in_attr[i].i && !out_attr[i].i) out_attr[i].i = in_attr[i].i; break; case Tag_ABI_align8_needed: diff --git a/ld/ChangeLog b/ld/ChangeLog index 4c5f7aed293..36d8560a1c8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +2008-07-18 Joseph Myers + + * ld.texinfo (--no-wchar-size-warning): Document new ARM option. + * emultempl/armelf.em (no_wchar_size_warning): New. + (arm_elf_create_output_section_statements): Pass + no_wchar_size_warning to arm_elf_create_output_section_statements. + (OPTION_NO_WCHAR_SIZE_WARNING): New. + (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning. + (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning. + (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning. + 2008-07-15 Jie Zhang * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index d142961c3f7..d1d68c00e1a 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -39,6 +39,7 @@ static int fix_v4bx = 0; static int use_blx = 0; static bfd_arm_vfp11_fix vfp11_denorm_fix = BFD_ARM_VFP11_FIX_DEFAULT; static int no_enum_size_warning = 0; +static int no_wchar_size_warning = 0; static int pic_veneer = 0; static void @@ -452,6 +453,7 @@ arm_elf_create_output_section_statements (void) target1_is_rel, target2_type, fix_v4bx, use_blx, vfp11_denorm_fix, no_enum_size_warning, + no_wchar_size_warning, pic_veneer); stub_file = lang_add_input_file ("linker stubs", @@ -509,6 +511,7 @@ PARSE_AND_LIST_PROLOGUE=' #define OPTION_PIC_VENEER 310 #define OPTION_FIX_V4BX_INTERWORKING 311 #define OPTION_STUBGROUP_SIZE 312 +#define OPTION_NO_WCHAR_SIZE_WARNING 313 ' PARSE_AND_LIST_SHORTOPTS=p @@ -527,6 +530,7 @@ PARSE_AND_LIST_LONGOPTS=' { "no-enum-size-warning", no_argument, NULL, OPTION_NO_ENUM_SIZE_WARNING}, { "pic-veneer", no_argument, NULL, OPTION_PIC_VENEER}, { "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE }, + { "no-wchar-size-warning", no_argument, NULL, OPTION_NO_WCHAR_SIZE_WARNING}, ' PARSE_AND_LIST_OPTIONS=' @@ -541,6 +545,8 @@ PARSE_AND_LIST_OPTIONS=' fprintf (file, _(" --vfp11-denorm-fix Specify how to fix VFP11 denorm erratum\n")); fprintf (file, _(" --no-enum-size-warning Don'\''t warn about objects with incompatible" " enum sizes\n")); + fprintf (file, _(" --no-wchar-size-warning Don'\''t warn about objects with incompatible" + " wchar_t sizes\n")); fprintf (file, _(" --pic-veneer Always generate PIC interworking veneers\n")); fprintf (file, _("\ --stub-group-size=N Maximum size of a group of input sections that can be\n\ @@ -605,6 +611,10 @@ PARSE_AND_LIST_ARGS_CASES=' no_enum_size_warning = 1; break; + case OPTION_NO_WCHAR_SIZE_WARNING: + no_wchar_size_warning = 1; + break; + case OPTION_PIC_VENEER: pic_veneer = 1; break; diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 4400524cea0..b752642f5f6 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -5709,6 +5709,14 @@ linking of an object file using 32-bit enumeration values with another using enumeration values fitted into the smallest possible space will not be diagnosed. +@cindex NO_WCHAR_SIZE_WARNING +@kindex --no-wchar-size-warning +The @option{--no-wchar-size-warning} switch prevents the linker from +warning when linking object files that specify incompatible EABI +@code{wchar_t} size attributes. For example, with this switch enabled, +linking of an object file using 32-bit @code{wchar_t} values with another +using 16-bit @code{wchar_t} values will not be diagnosed. + @cindex PIC_VENEER @kindex --pic-veneer The @samp{--pic-veneer} switch makes the linker use PIC sequences for diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 2403d5233d4..f613aec47ee 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2008-07-18 Joseph Myers + + * ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s, + ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d, + ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d, + ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d, + ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d, + ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d, + ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d, + ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d, + ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d, + ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d, + ld-arm/attr-merge-wchar-44.d: New. + * ld-arm/arm-elf.exp: Run new tests. + 2008-07-11 H.J. Lu * ld-m68k/got-12.s: Removed. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 7df49f4519a..c01c795cb28 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -283,6 +283,24 @@ set armeabitests { } run_ld_link_tests $armeabitests +run_dump_test "attr-merge-wchar-00" +run_dump_test "attr-merge-wchar-02" +run_dump_test "attr-merge-wchar-04" +run_dump_test "attr-merge-wchar-20" +run_dump_test "attr-merge-wchar-22" +run_dump_test "attr-merge-wchar-24" +run_dump_test "attr-merge-wchar-40" +run_dump_test "attr-merge-wchar-42" +run_dump_test "attr-merge-wchar-44" +run_dump_test "attr-merge-wchar-00-nowarn" +run_dump_test "attr-merge-wchar-02-nowarn" +run_dump_test "attr-merge-wchar-04-nowarn" +run_dump_test "attr-merge-wchar-20-nowarn" +run_dump_test "attr-merge-wchar-22-nowarn" +run_dump_test "attr-merge-wchar-24-nowarn" +run_dump_test "attr-merge-wchar-40-nowarn" +run_dump_test "attr-merge-wchar-42-nowarn" +run_dump_test "attr-merge-wchar-44-nowarn" run_dump_test "farcall-thumb-thumb" run_dump_test "farcall-thumb-thumb-pic-veneer" run_dump_test "farcall-thumb-thumb-m-pic-veneer" diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-0.s b/ld/testsuite/ld-arm/attr-merge-wchar-0.s new file mode 100644 index 00000000000..ef19a88518a --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-0.s @@ -0,0 +1,11 @@ + .cpu arm7tdmi + .fpu softvfp + .eabi_attribute 20, 1 + .eabi_attribute 21, 1 + .eabi_attribute 23, 3 + .eabi_attribute 24, 1 + .eabi_attribute 25, 1 + .eabi_attribute 26, 1 + .eabi_attribute 30, 6 + .eabi_attribute 18, 0 + .file "attr-merge-wchar-0.s" diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-00-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-00-nowarn.d new file mode 100644 index 00000000000..e850c6438ee --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-00-nowarn.d @@ -0,0 +1,17 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-00.d b/ld/testsuite/ld-arm/attr-merge-wchar-00.d new file mode 100644 index 00000000000..1fcf7c0fe92 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-00.d @@ -0,0 +1,17 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-02-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-02-nowarn.d new file mode 100644 index 00000000000..f6b7a68da73 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-02-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-02.d b/ld/testsuite/ld-arm/attr-merge-wchar-02.d new file mode 100644 index 00000000000..dc907eef781 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-02.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-04-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-04-nowarn.d new file mode 100644 index 00000000000..b369b78b729 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-04-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-04.d b/ld/testsuite/ld-arm/attr-merge-wchar-04.d new file mode 100644 index 00000000000..9aa3c4702d0 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-04.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-0.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-2.s b/ld/testsuite/ld-arm/attr-merge-wchar-2.s new file mode 100644 index 00000000000..4b3b96b2466 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-2.s @@ -0,0 +1,11 @@ + .cpu arm7tdmi + .fpu softvfp + .eabi_attribute 20, 1 + .eabi_attribute 21, 1 + .eabi_attribute 23, 3 + .eabi_attribute 24, 1 + .eabi_attribute 25, 1 + .eabi_attribute 26, 1 + .eabi_attribute 30, 6 + .eabi_attribute 18, 2 + .file "attr-merge-wchar-2.s" diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-20-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-20-nowarn.d new file mode 100644 index 00000000000..8cfb68226ba --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-20-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-20.d b/ld/testsuite/ld-arm/attr-merge-wchar-20.d new file mode 100644 index 00000000000..1ba47f19cc7 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-20.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-22-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-22-nowarn.d new file mode 100644 index 00000000000..4a3d37e892e --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-22-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-22.d b/ld/testsuite/ld-arm/attr-merge-wchar-22.d new file mode 100644 index 00000000000..23c072662fd --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-22.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-24-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-24-nowarn.d new file mode 100644 index 00000000000..cadd7da5c4a --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-24-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 2 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-24.d b/ld/testsuite/ld-arm/attr-merge-wchar-24.d new file mode 100644 index 00000000000..46d6c66f353 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-24.d @@ -0,0 +1,5 @@ +#source: attr-merge-wchar-2.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r +#warning: warning: .* uses 4-byte wchar_t yet the output is to use 2-byte wchar_t; use of wchar_t values across objects may fail diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-4.s b/ld/testsuite/ld-arm/attr-merge-wchar-4.s new file mode 100644 index 00000000000..fdd03f9fe55 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-4.s @@ -0,0 +1,11 @@ + .cpu arm7tdmi + .fpu softvfp + .eabi_attribute 20, 1 + .eabi_attribute 21, 1 + .eabi_attribute 23, 3 + .eabi_attribute 24, 1 + .eabi_attribute 25, 1 + .eabi_attribute 26, 1 + .eabi_attribute 30, 6 + .eabi_attribute 18, 4 + .file "attr-merge-wchar-4.s" diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-40-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-40-nowarn.d new file mode 100644 index 00000000000..9d6e04099c2 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-40-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-40.d b/ld/testsuite/ld-arm/attr-merge-wchar-40.d new file mode 100644 index 00000000000..fcf9b547e66 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-40.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-0.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-42-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-42-nowarn.d new file mode 100644 index 00000000000..8dbc4421864 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-42-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-42.d b/ld/testsuite/ld-arm/attr-merge-wchar-42.d new file mode 100644 index 00000000000..c2aca5e67cc --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-42.d @@ -0,0 +1,5 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-2.s +#as: +#ld: -r +#warning: warning: .* uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-44-nowarn.d b/ld/testsuite/ld-arm/attr-merge-wchar-44-nowarn.d new file mode 100644 index 00000000000..7566d2aebbc --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-44-nowarn.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r --no-wchar-size-warning +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug diff --git a/ld/testsuite/ld-arm/attr-merge-wchar-44.d b/ld/testsuite/ld-arm/attr-merge-wchar-44.d new file mode 100644 index 00000000000..430de30d218 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-wchar-44.d @@ -0,0 +1,18 @@ +#source: attr-merge-wchar-4.s +#source: attr-merge-wchar-4.s +#as: +#ld: -r +#readelf: -A + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "ARM7TDMI" + Tag_CPU_arch: v4T + Tag_ABI_PCS_wchar_t: 4 + Tag_ABI_FP_denormal: Needed + Tag_ABI_FP_exceptions: Needed + Tag_ABI_FP_number_model: IEEE 754 + Tag_ABI_align8_needed: Yes + Tag_ABI_align8_preserved: Yes, except leaf SP + Tag_ABI_enum_size: small + Tag_ABI_optimization_goals: Aggressive Debug -- 2.30.2