summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2015-11-17 16:29:47 -0800
committerHan Shen <shenhan@google.com>2015-11-19 17:29:00 -0800
commit8bfb6b2bf11cfbc445239158ec28d0988f8fa947 (patch)
tree64baf9be2b2d76eb0d3d83ec6acf3d5ddd452b64 /binutils-2.25/bfd/elfxx-mips.c
parent932d71b859239e834651fdee549dc661cda82fe8 (diff)
downloadtoolchain_binutils-8bfb6b2bf11cfbc445239158ec28d0988f8fa947.tar.gz
toolchain_binutils-8bfb6b2bf11cfbc445239158ec28d0988f8fa947.tar.bz2
toolchain_binutils-8bfb6b2bf11cfbc445239158ec28d0988f8fa947.zip
Create an unified binutils source tree for both Android and ChromiumOS.
About source code - The base version of this binutils is newer than that of aosp/binutils-2.25, it is based on the binutils that is used to build google products and ChromiumOS. And it contains *all* local Android patches as well as all patches that are cherry-picked from upstream for aosp/binutils-2.25 tree (up to Nov. 5 - 932d71b85). You may find the detailed development history for this binutils tree here - https://chromium.googlesource.com/chromiumos/third_party/binutils/+log/unification (This CL is a combination of all the CLs in it. After this CL is submitted the tree will be identical to https://chromium.googlesource.com/chromiumos/third_party/binutils/+log/unification at 2865a3615d80bd5f82d14d7e0484e84dc052596a) About testing - We tested this binutils for both ChromiumOS and Android. For android, we tested building N4, N5X, N6, N7, N9 using new binutils, we also did a full-build of toolchain (by build.py) and built a N5X image; for ChromiumOS - it passed ChromiumOS toolchain release tests on all 4 platforms (x86, x86_64, arm32 and arm64). Change-Id: I2bb2cf579f9458d0a8bc9612331dc7d5043e3d82
Diffstat (limited to 'binutils-2.25/bfd/elfxx-mips.c')
-rw-r--r--binutils-2.25/bfd/elfxx-mips.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/binutils-2.25/bfd/elfxx-mips.c b/binutils-2.25/bfd/elfxx-mips.c
index cb6fd21b..998549da 100644
--- a/binutils-2.25/bfd/elfxx-mips.c
+++ b/binutils-2.25/bfd/elfxx-mips.c
@@ -6607,6 +6607,9 @@ _bfd_elf_mips_mach (flagword flags)
case E_MIPS_MACH_LS3A:
return bfd_mach_mips_loongson_3a;
+ case E_MIPS_MACH_OCTEON3:
+ return bfd_mach_mips_octeon3;
+
case E_MIPS_MACH_OCTEON2:
return bfd_mach_mips_octeon2;
@@ -7002,20 +7005,11 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr)
if (strcmp (name, ".sdata") == 0
|| strcmp (name, ".lit8") == 0
|| strcmp (name, ".lit4") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
else if (strcmp (name, ".srdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL;
else if (strcmp (name, ".compact_rel") == 0)
- {
- hdr->sh_flags = 0;
- hdr->sh_type = SHT_PROGBITS;
- }
+ hdr->sh_flags = 0;
else if (strcmp (name, ".rtproc") == 0)
{
if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0)
@@ -11480,9 +11474,11 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
name = ".dynsym";
elemsize = MIPS_ELF_SYM_SIZE (output_bfd);
s = bfd_get_section_by_name (output_bfd, name);
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_val = s->size / elemsize;
+ if (s != NULL)
+ dyn.d_un.d_val = s->size / elemsize;
+ else
+ dyn.d_un.d_val = 0;
break;
case DT_MIPS_HIPAGENO:
@@ -11906,6 +11902,10 @@ mips_set_isa_flags (bfd *abfd)
val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON;
break;
+ case bfd_mach_mips_octeon3:
+ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON3;
+ break;
+
case bfd_mach_mips_xlr:
val = E_MIPS_ARCH_64 | E_MIPS_MACH_XLR;
break;
@@ -13959,6 +13959,8 @@ bfd_mips_isa_ext (bfd *abfd)
return AFL_EXT_OCTEON;
case bfd_mach_mips_octeonp:
return AFL_EXT_OCTEONP;
+ case bfd_mach_mips_octeon3:
+ return AFL_EXT_OCTEON3;
case bfd_mach_mips_octeon2:
return AFL_EXT_OCTEON2;
case bfd_mach_mips_xlr:
@@ -14792,6 +14794,7 @@ struct mips_mach_extension
static const struct mips_mach_extension mips_mach_extensions[] =
{
/* MIPS64r2 extensions. */
+ { bfd_mach_mips_octeon3, bfd_mach_mips_octeon2 },
{ bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
{ bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
{ bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
@@ -15588,6 +15591,9 @@ print_mips_isa_ext (FILE *file, unsigned int isa_ext)
case AFL_EXT_XLR:
fputs ("RMI XLR", file);
break;
+ case AFL_EXT_OCTEON3:
+ fputs ("Cavium Networks Octeon3", file);
+ break;
case AFL_EXT_OCTEON2:
fputs ("Cavium Networks Octeon2", file);
break;