GNU Binutils with patches for OS216
修訂 | 5f4ce26d93f3ab6eb1f46eef54d091d18fd73549 (tree) |
---|---|
時間 | 2000-10-28 07:39:05 |
作者 | Phil Blundell <philb@gnu....> |
Commiter | Phil Blundell |
2000-10-27 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse
attempts to mix PIC code with non-PIC, just mark the output as
being position dependent.
(elf32_arm_merge_private_bfd_data): Likewise. Print an error
message for EF_SOFT_FLOAT mismatches. Display diagnostics for
all mismatches, not just the first one.
@@ -1,3 +1,12 @@ | ||
1 | +2000-10-27 Philip Blundell <philb@gnu.org> | |
2 | + | |
3 | + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse | |
4 | + attempts to mix PIC code with non-PIC, just mark the output as | |
5 | + being position dependent. | |
6 | + (elf32_arm_merge_private_bfd_data): Likewise. Print an error | |
7 | + message for EF_SOFT_FLOAT mismatches. Display diagnostics for | |
8 | + all mismatches, not just the first one. | |
9 | + | |
1 | 10 | 2000-10-23 Philip Blundell <pb@futuretv.com> |
2 | 11 | |
3 | 12 | From 2000-05-23 H.J. Lu <hjl@gnu.org> |
@@ -1933,10 +1933,6 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) | ||
1933 | 1933 | |
1934 | 1934 | if (elf_flags_init (obfd) && in_flags != out_flags) |
1935 | 1935 | { |
1936 | - /* Cannot mix PIC and non-PIC code. */ | |
1937 | - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) | |
1938 | - return false; | |
1939 | - | |
1940 | 1936 | /* Cannot mix APCS26 and APCS32 code. */ |
1941 | 1937 | if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) |
1942 | 1938 | return false; |
@@ -1956,6 +1952,10 @@ Warning: Clearing the interwork flag in %s because non-interworking code in %s h | ||
1956 | 1952 | |
1957 | 1953 | in_flags &= ~EF_INTERWORK; |
1958 | 1954 | } |
1955 | + | |
1956 | + /* Likewise for PIC, though don't warn for this case. */ | |
1957 | + if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) | |
1958 | + in_flags &= ~EF_PIC; | |
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | elf_elfheader (obfd)->e_flags = in_flags; |
@@ -1973,6 +1973,7 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) | ||
1973 | 1973 | { |
1974 | 1974 | flagword out_flags; |
1975 | 1975 | flagword in_flags; |
1976 | + boolean flags_compatible = true; | |
1976 | 1977 | |
1977 | 1978 | if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour |
1978 | 1979 | || bfd_get_flavour (obfd) != bfd_target_elf_flavour) |
@@ -2024,48 +2025,59 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) | ||
2024 | 2025 | return true; |
2025 | 2026 | } |
2026 | 2027 | |
2027 | - /* Check flag compatibility. */ | |
2028 | + /* Identical flags must be compatible. */ | |
2028 | 2029 | if (in_flags == out_flags) |
2029 | 2030 | return true; |
2030 | 2031 | |
2031 | - /* Complain about various flag mismatches. */ | |
2032 | + /* If any of the input BFDs is non-PIC, the output is also position | |
2033 | + dependent. */ | |
2034 | + if (!(in_flags & EF_PIC)) | |
2035 | + elf_elfheader (obfd)->e_flags &= ~EF_PIC; | |
2032 | 2036 | |
2037 | + /* Complain about various flag mismatches. */ | |
2033 | 2038 | if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) |
2034 | - _bfd_error_handler (_ ("\ | |
2039 | + { | |
2040 | + _bfd_error_handler (_ ("\ | |
2035 | 2041 | Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), |
2036 | 2042 | bfd_get_filename (ibfd), |
2037 | 2043 | in_flags & EF_APCS_26 ? 26 : 32, |
2038 | 2044 | bfd_get_filename (obfd), |
2039 | 2045 | out_flags & EF_APCS_26 ? 26 : 32); |
2046 | + flags_compatible = false; | |
2047 | + } | |
2040 | 2048 | |
2041 | 2049 | if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) |
2042 | - _bfd_error_handler (_ ("\ | |
2050 | + { | |
2051 | + _bfd_error_handler (_ ("\ | |
2043 | 2052 | Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), |
2044 | 2053 | bfd_get_filename (ibfd), |
2045 | 2054 | in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"), |
2046 | 2055 | bfd_get_filename (obfd), |
2047 | 2056 | out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); |
2057 | + flags_compatible = false; | |
2058 | + } | |
2048 | 2059 | |
2049 | - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) | |
2050 | - _bfd_error_handler (_ ("\ | |
2051 | -Error: %s is compiled as position %s code, whereas %s is not"), | |
2052 | - bfd_get_filename (ibfd), | |
2053 | - in_flags & EF_PIC ? _ ("independent") : _ ("dependent"), | |
2054 | - bfd_get_filename (obfd)); | |
2055 | - | |
2056 | - /* Interworking mismatch is only a warning. */ | |
2057 | - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) | |
2060 | + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) | |
2058 | 2061 | { |
2059 | 2062 | _bfd_error_handler (_ ("\ |
2063 | +Error: %s uses %s floating point, whereas %s uses %s floating point"), | |
2064 | + bfd_get_filename (ibfd), | |
2065 | + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), | |
2066 | + bfd_get_filename (obfd), | |
2067 | + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); | |
2068 | + flags_compatible = false; | |
2069 | + } | |
2070 | + | |
2071 | + /* Interworking mismatch is only a warning. */ | |
2072 | + if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) | |
2073 | + _bfd_error_handler (_ ("\ | |
2060 | 2074 | Warning: %s %s interworking, whereas %s %s"), |
2061 | 2075 | bfd_get_filename (ibfd), |
2062 | 2076 | in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"), |
2063 | 2077 | bfd_get_filename (obfd), |
2064 | 2078 | out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); |
2065 | - return true; | |
2066 | - } | |
2067 | 2079 | |
2068 | - return false; | |
2080 | + return flags_compatible; | |
2069 | 2081 | } |
2070 | 2082 | |
2071 | 2083 | /* Display the flags field */ |