diff options
author | DJ Delorie <dj@redhat.com> | 2011-06-02 00:51:19 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2011-06-02 00:51:19 +0000 |
commit | 4c422395e61397529b6bbafc7fa5c0e28b4c56dc (patch) | |
tree | 22e3d308a280922a00d999514a3f6eccc88d2f74 | |
parent | a39ef331205f8654a8f97447423065312db3000a (diff) | |
download | gdb-4c422395e61397529b6bbafc7fa5c0e28b4c56dc.zip gdb-4c422395e61397529b6bbafc7fa5c0e28b4c56dc.tar.gz gdb-4c422395e61397529b6bbafc7fa5c0e28b4c56dc.tar.bz2 |
* config.bfd: Add bfd_elf32_rx_be_ns_vec.
* target.c: Likewise.
* configure.in: Likewise.
* configure.in: Regenerate.
* elf32-rx.c: Add elf32-rx-be-ns target.
(rx_elf_object_p): Never allow the be-ns target by default,
only allow it if the user requests it.
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/config.bfd | 2 | ||||
-rwxr-xr-x | bfd/configure | 1 | ||||
-rw-r--r-- | bfd/configure.in | 1 | ||||
-rw-r--r-- | bfd/elf32-rx.c | 30 | ||||
-rw-r--r-- | bfd/targets.c | 2 |
6 files changed, 45 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a3ca64b..ca82b1e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2011-06-01 DJ Delorie <dj@redhat.com> + + * config.bfd: Add bfd_elf32_rx_be_ns_vec. + * target.c: Likewise. + * configure.in: Likewise. + * configure.in: Regenerate. + * elf32-rx.c: Add elf32-rx-be-ns target. + (rx_elf_object_p): Never allow the be-ns target by default, + only allow it if the user requests it. + 2011-06-01 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn diff --git a/bfd/config.bfd b/bfd/config.bfd index 7e9f2d3..d009ee4 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1189,7 +1189,7 @@ case "${targ}" in rx-*-elf) targ_defvec=bfd_elf32_rx_le_vec - targ_selvecs="bfd_elf32_rx_be_vec bfd_elf32_rx_le_vec" + targ_selvecs="bfd_elf32_rx_be_vec bfd_elf32_rx_le_vec bfd_elf32_rx_be_ns_vec" ;; s390-*-linux*) diff --git a/bfd/configure b/bfd/configure index 2c4c1a4..2e8ece2 100755 --- a/bfd/configure +++ b/bfd/configure @@ -15264,6 +15264,7 @@ do bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; + bfd_elf32_rx_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;; bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;; diff --git a/bfd/configure.in b/bfd/configure.in index d9ca1ce..7457646 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -763,6 +763,7 @@ do bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; + bfd_elf32_rx_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;; bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;; diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index 7e4bf96..f049f6e 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -28,6 +28,11 @@ #define RX_OPCODE_BIG_ENDIAN 0 +/* This is a meta-target that's used only with objcopy, to avoid the + endian-swap we would otherwise get. We check for this in + rx_elf_object_p(). */ +const bfd_target bfd_elf32_rx_be_ns_vec; + #ifdef DEBUG char * rx_get_reloc (long); void rx_dump_symtab (bfd *, void *, void *); @@ -2960,6 +2965,13 @@ rx_elf_object_p (bfd * abfd) int nphdrs = elf_elfheader (abfd)->e_phnum; sec_ptr bsec; + /* We never want to automatically choose the non-swapping big-endian + target. The user can only get that explicitly, such as with -I + and objcopy. */ + if (abfd->xvec == &bfd_elf32_rx_be_ns_vec + && abfd->target_defaulted) + return FALSE; + bfd_default_set_arch_mach (abfd, bfd_arch_rx, elf32_rx_machine (abfd)); @@ -3436,3 +3448,21 @@ elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED, #define bfd_elf32_bfd_relax_section elf32_rx_relax_section_wrapper #include "elf32-target.h" + +/* We define a second big-endian target that doesn't have the custom + section get/set hooks, for times when we want to preserve the + pre-swapped .text sections (like objcopy). */ + +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_rx_be_ns_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf32-rx-be-ns" +#undef TARGET_LITTLE_SYM + +#undef bfd_elf32_get_section_contents +#undef bfd_elf32_set_section_contents + +#undef elf32_bed +#define elf32_bed elf32_rx_be_ns_bed + +#include "elf32-target.h" diff --git a/bfd/targets.c b/bfd/targets.c index 3249867..47341af 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -657,6 +657,7 @@ extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_powerpc_vxworks_vec; extern const bfd_target bfd_elf32_rx_le_vec; extern const bfd_target bfd_elf32_rx_be_vec; +extern const bfd_target bfd_elf32_rx_be_ns_vec; extern const bfd_target bfd_elf32_s390_vec; extern const bfd_target bfd_elf32_bigscore_vec; extern const bfd_target bfd_elf32_littlescore_vec; @@ -1014,6 +1015,7 @@ static const bfd_target * const _bfd_target_vector[] = &bfd_elf32_powerpc_vxworks_vec, &bfd_elf32_powerpcle_vec, &bfd_elf32_rx_be_vec, + &bfd_elf32_rx_be_ns_vec, &bfd_elf32_rx_le_vec, &bfd_elf32_s390_vec, #ifdef BFD64 |