From 6b31fd3af359b3478037f5e2f38da8f953e15b86 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 14 Oct 1996 15:21:54 +0000 Subject: Mon Oct 14 11:17:24 1996 Richard Henderson * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a mistake to have reused the ECOFF LITERAL for ELF since they have different semantics. * elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL. * bfd-in2.h, libbfd.h: Rebuild. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got section overflow. * elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a dynamic relocation for an undefweak symbol when we are building a static executable. --- bfd/reloc.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'bfd/reloc.c') diff --git a/bfd/reloc.c b/bfd/reloc.c index 05d51e9..cf0674a 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -138,7 +138,7 @@ DESCRIPTION type which modifies the bottom two bytes of a four byte word would not touch the first byte pointed to in a big endian world. - + o <> The <> is a value provided by the back end to be added (!) @@ -1073,12 +1073,12 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, { /* This is a partial relocation, but inplace, so modify the reloc record a bit. - + If we've relocated with a symbol with a section, change into a ref to the section belonging to the symbol. */ - + reloc_entry->address += input_section->output_offset; - + /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 @@ -1090,10 +1090,10 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* For m68k-coff, the addend was being subtracted twice during relocation with -r. Removing the line below this comment fixes that problem; see PR 2953. - + However, Ian wrote the following, regarding removing the line below, which explains why it is still enabled: --djm - + If you put a patch like that into BFD you need to check all the COFF linkers. I am fairly certain that patch will break coff-i386 (e.g., SCO); see coff_i386_reloc in coff-i386.c where I worked around the @@ -1904,6 +1904,8 @@ ENUMDOC ENUM BFD_RELOC_ALPHA_LITERAL ENUMX + BFD_RELOC_ALPHA_ELF_LITERAL +ENUMX BFD_RELOC_ALPHA_LITUSE ENUMDOC The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; @@ -1915,6 +1917,12 @@ ENUMDOC in with the file's GP value on reading, for convenience, as with the GPDISP_LO16 reloc. + The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. + It should refer to the symbol to be referenced, as with 16_GOTOFF, + but it generates output not based on the position within the .got + section, but relative to the GP value chosen for the file during the + final link stage. + The LITUSE reloc, on the instruction using the loaded address, gives information to the linker that it might be able to use to optimize away some literal section references. The symbol is ignored (read @@ -2244,22 +2252,22 @@ COMMENT COMMENT {* start-sanitize-m32r *} ENUM - BFD_RELOC_M32R_10_PCREL + BFD_RELOC_M32R_UIMM24 ENUMDOC Mitsubishi M32R relocs. + This is a 24 bit address. +ENUM + BFD_RELOC_M32R_DISP8 +ENUMDOC This is a 10-bit reloc with the right 2 bits assumed to be 0. ENUM - BFD_RELOC_M32R_18_PCREL + BFD_RELOC_M32R_DISP16 ENUMDOC This is an 18-bit reloc with the right 2 bits assumed to be 0. ENUM - BFD_RELOC_M32R_26_PCREL + BFD_RELOC_M32R_DISP24 ENUMDOC This is an 26-bit reloc with the right 2 bits assumed to be 0. -ENUM - BFD_RELOC_M32R_24 -ENUMDOC - This is a 24 bit reloc. COMMENT {* end-sanitize-m32r *} -- cgit v1.1