diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/readelf.c | 50 |
2 files changed, 56 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 73bb197..cdff4b0 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2008-09-17 Jan Kratochvil <jan.kratochvil@redhat.com> + + Suppress warnings on NONE relocations to discarded sections. + * readelf.c (is_none_reloc): New function. + (debug_apply_relocations): Ignore is_none_reloc() relocations. + 2008-09-11 Jan Kratochvil <jan.kratochvil@redhat.com> Fix loading large elf64 binaries on 32bit hosts. diff --git a/binutils/readelf.c b/binutils/readelf.c index 9f1008c..2d356a6 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -8284,6 +8284,53 @@ is_16bit_abs_reloc (unsigned int reloc_type) } } +/* Returns TRUE iff RELOC_TYPE is a NONE relocation used for discarded + relocation entries (possibly formerly used for SHT_GROUP sections). */ + +static bfd_boolean +is_none_reloc (unsigned int reloc_type) +{ + switch (elf_header.e_machine) + { + case EM_68K: + return reloc_type == 0; /* R_68K_NONE. */ + case EM_386: + return reloc_type == 0; /* R_386_NONE. */ + case EM_SPARC32PLUS: + case EM_SPARCV9: + case EM_SPARC: + return reloc_type == 0; /* R_SPARC_NONE. */ + case EM_MIPS: + return reloc_type == 0; /* R_MIPS_NONE. */ + case EM_PARISC: + return reloc_type == 0; /* R_PARISC_NONE. */ + case EM_ALPHA: + return reloc_type == 0; /* R_ALPHA_NONE. */ + case EM_PPC: + return reloc_type == 0; /* R_PPC_NONE. */ + case EM_PPC64: + return reloc_type == 0; /* R_PPC64_NONE. */ + case EM_ARM: + return reloc_type == 0; /* R_ARM_NONE. */ + case EM_IA_64: + return reloc_type == 0; /* R_IA64_NONE. */ + case EM_SH: + return reloc_type == 0; /* R_SH_NONE. */ + case EM_S390_OLD: + case EM_S390: + return reloc_type == 0; /* R_390_NONE. */ + case EM_CRIS: + return reloc_type == 0; /* R_CRIS_NONE. */ + case EM_X86_64: + return reloc_type == 0; /* R_X86_64_NONE. */ + case EM_MN10300: + return reloc_type == 0; /* R_MN10300_NONE. */ + case EM_M32R: + return reloc_type == 0; /* R_M32R_NONE. */ + } + return FALSE; +} + /* Uncompresses a section that was compressed using zlib, in place. * This is a copy of bfd_uncompress_section_contents, in bfd/compress.c */ @@ -8419,6 +8466,9 @@ debug_apply_relocations (void *file, reloc_type = get_reloc_type (rp->r_info); + if (is_none_reloc (reloc_type)) + continue; + if (is_32bit_abs_reloc (reloc_type) || is_32bit_pcrel_reloc (reloc_type)) reloc_size = 4; |