/* Provided the symbol, returns the value reffed */
static long
-get_symbol_value (symbol)
+get_symbol_value (symbol)
asymbol *symbol;
-{
+{
long relocation = 0;
if (bfd_is_com_section (symbol->section))
{
- relocation = 0;
+ relocation = 0;
}
- else
- {
+ else
+ {
relocation = symbol->value +
symbol->section->output_section->vma +
symbol->section->output_offset;
- }
+ }
return(relocation);
}
unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/
bfd_byte *hit_data =addr + (bfd_byte *)(data);
-
+
r_type = reloc_entry->howto->type;
if (output_bfd) {
&& bfd_is_und_section (symbol_in->section))
{
/* Keep the state machine happy in case we're called again */
- if (r_type == R_IHIHALF)
+ if (r_type == R_IHIHALF)
{
part1_consth_active = true;
part1_consth_value = 0;
return(bfd_reloc_undefined);
}
- if ((part1_consth_active) && (r_type != R_IHCONST))
+ if ((part1_consth_active) && (r_type != R_IHCONST))
{
part1_consth_active = false;
*error_message = (char *) _("Missing IHCONST");
return(bfd_reloc_dangerous);
}
-
sym_value = get_symbol_value(symbol_in);
- switch (r_type)
+ switch (r_type)
{
- case R_IREL:
- insn = bfd_get_32(abfd, hit_data);
+ case R_IREL:
+ insn = bfd_get_32(abfd, hit_data);
/* Take the value in the field and sign extend it */
signed_value = EXTRACT_HWORD(insn);
signed_value = SIGN_EXTEND_HWORD(signed_value);
{ /* Absolute jmp/call */
insn |= (1<<24); /* Make it absolute */
/* FIXME: Should we change r_type to R_IABS */
- }
- else
+ }
+ else
{
/* Relative jmp/call, so subtract from the value the
address of the place we're coming from */
signed_value -= (reloc_entry->address
+ input_section->output_section->vma
+ input_section->output_offset);
- if (signed_value>0x1ffff || signed_value<-0x20000)
+ if (signed_value>0x1ffff || signed_value<-0x20000)
return(bfd_reloc_overflow);
}
signed_value >>= 2;
insn = INSERT_HWORD(insn, signed_value);
- bfd_put_32(abfd, insn ,hit_data);
+ bfd_put_32(abfd, insn ,hit_data);
break;
- case R_ILOHALF:
- insn = bfd_get_32(abfd, hit_data);
+ case R_ILOHALF:
+ insn = bfd_get_32(abfd, hit_data);
unsigned_value = EXTRACT_HWORD(insn);
unsigned_value += sym_value + reloc_entry->addend;
insn = INSERT_HWORD(insn, unsigned_value);
- bfd_put_32(abfd, insn, hit_data);
+ bfd_put_32(abfd, insn, hit_data);
break;
case R_IHIHALF:
- insn = bfd_get_32(abfd, hit_data);
- /* consth, part 1
+ insn = bfd_get_32(abfd, hit_data);
+ /* consth, part 1
Just get the symbol value that is referenced */
part1_consth_active = true;
part1_consth_value = sym_value + reloc_entry->addend;
/* Don't modify insn until R_IHCONST */
break;
- case R_IHCONST:
- insn = bfd_get_32(abfd, hit_data);
- /* consth, part 2
+ case R_IHCONST:
+ insn = bfd_get_32(abfd, hit_data);
+ /* consth, part 2
Now relocate the reference */
if (part1_consth_active == false) {
*error_message = (char *) _("Missing IHIHALF");
unsigned_value = unsigned_value >> 16;
insn = INSERT_HWORD(insn, unsigned_value);
part1_consth_active = false;
- bfd_put_32(abfd, insn, hit_data);
+ bfd_put_32(abfd, insn, hit_data);
break;
case R_BYTE:
- insn = bfd_get_8(abfd, hit_data);
- unsigned_value = insn + sym_value + reloc_entry->addend;
+ insn = bfd_get_8(abfd, hit_data);
+ unsigned_value = insn + sym_value + reloc_entry->addend;
if (unsigned_value & 0xffffff00)
return(bfd_reloc_overflow);
- bfd_put_8(abfd, unsigned_value, hit_data);
+ bfd_put_8(abfd, unsigned_value, hit_data);
break;
case R_HWORD:
- insn = bfd_get_16(abfd, hit_data);
- unsigned_value = insn + sym_value + reloc_entry->addend;
+ insn = bfd_get_16(abfd, hit_data);
+ unsigned_value = insn + sym_value + reloc_entry->addend;
if (unsigned_value & 0xffff0000)
return(bfd_reloc_overflow);
- bfd_put_16(abfd, insn, hit_data);
+ bfd_put_16(abfd, insn, hit_data);
break;
case R_WORD:
- insn = bfd_get_32(abfd, hit_data);
- insn += sym_value + reloc_entry->addend;
+ insn = bfd_get_32(abfd, hit_data);
+ insn += sym_value + reloc_entry->addend;
bfd_put_32(abfd, insn, hit_data);
break;
default:
return (bfd_reloc_dangerous);
}
-
- return(bfd_reloc_ok);
+ return(bfd_reloc_ok);
}
/* type rightshift
complain_on_overflow
special_function
relocation name
- partial_inplace
+ partial_inplace
src_mask
*/
/*FIXME: I'm not real sure about this table */
-static reloc_howto_type howto_table[] =
+static reloc_howto_type howto_table[] =
{
{R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false},
EMPTY_HOWTO (1),
{
static bfd_vma ihihalf_vaddr = (bfd_vma) -1;
- relent->address = reloc->r_vaddr;
+ relent->address = reloc->r_vaddr;
relent->howto = howto_table + reloc->r_type;
- if (reloc->r_type == R_IHCONST)
- {
+ if (reloc->r_type == R_IHCONST)
+ {
/* The address of an R_IHCONST should always be the address of
the immediately preceding R_IHIHALF. relocs generated by gas
are correct, but relocs generated by High C are different (I
abort ();
relent->address = ihihalf_vaddr;
ihihalf_vaddr = (bfd_vma) -1;
- relent->addend = reloc->r_symndx;
+ relent->addend = reloc->r_symndx;
relent->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr;
}
- else
+ else
{
asymbol *ptr;
relent->sym_ptr_ptr = symbols + obj_convert(abfd)[reloc->r_symndx];
ptr = *(relent->sym_ptr_ptr);
- if (ptr
- && bfd_asymbol_bfd(ptr) == abfd
+ if (ptr
+ && bfd_asymbol_bfd(ptr) == abfd
- && ((ptr->flags & BSF_OLD_COMMON)== 0))
- {
+ && ((ptr->flags & BSF_OLD_COMMON)== 0))
+ {
relent->addend = 0;
- }
+ }
else
- {
- relent->addend = 0;
- }
+ {
+ relent->addend = 0;
+ }
relent->address-= section->vma;
if (reloc->r_type == R_IHIHALF)
ihihalf_vaddr = relent->address;
rel->r_vaddr - input_section->vma)))
return false;
}
- }
+ }
return true;
}
/* We don't want to change the symndx of a R_IHCONST reloc, since it
is actually an addend, not a symbol index at all. */
-/*ARGSUSED*/
static boolean
coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
bfd *obfd ATTRIBUTE_UNUSED;
does not cause anything to happen, itself. */
rel->address += input_section->output_offset;
break;
-
+
case ALPHA_R_GPDISP:
/* This marks the ldah of an ldah/lda pair which loads the
gp register with the difference of the gp value and the
rel->address += input_section->output_offset;
}
break;
-
+
case ALPHA_R_OP_PUSH:
/* Push a value on the reloc evaluation stack. */
{
stack[tos - 1] >>= relocation;
}
break;
-
+
case ALPHA_R_GPVALUE:
/* I really don't know if this does the right thing. */
gp = rel->addend;
os->reloc_count++;
}
- if (r != bfd_reloc_ok)
+ if (r != bfd_reloc_ok)
{
switch (r)
{
input_bfd, input_section, rel->address, true)))
goto error_return;
break;
- case bfd_reloc_dangerous:
+ case bfd_reloc_dangerous:
if (! ((*link_info->callbacks->reloc_dangerous)
(link_info, err, input_bfd, input_section,
rel->address)))
r_symndx = RELOC_SECTION_XDATA;
break;
}
-
+
if (r_symndx == -1)
abort ();
pointer. To support large programs, we need to allow multiple
global pointers. This works as long as each input .lita section
is <64KB big. This implies that when producing relocatable
- output, the .lita section is limited to 64KB. . */
+ output, the .lita section is limited to 64KB. . */
lita_sec = symndx_to_section[RELOC_SECTION_LITA];
gp = _bfd_get_gp_value (output_bfd);
/* See ALPHA_R_LITERAL above for the uses of this reloc. It
does not cause anything to happen, itself. */
break;
-
+
case ALPHA_R_GPDISP:
/* This marks the ldah of an ldah/lda pair which loads the
gp register with the difference of the gp value and the
gp_usedp = true;
}
break;
-
+
case ALPHA_R_OP_PUSH:
case ALPHA_R_OP_PSUB:
case ALPHA_R_OP_PRSHIFT:
/* Do final adjustments to the filehdr and the aouthdr. This routine
sets the dynamic bits in the file header. */
-/*ARGSUSED*/
static boolean
alpha_adjust_headers (abfd, fhdr, ahdr)
bfd *abfd;
left = size;
- /* I don't know what the next eight bytes are for. */
+ /* I don't know what the next eight bytes are for. */
if (bfd_read (ab, 1, 8, nbfd) != 8)
goto error_return;
error_return:
if (nbfd != NULL)
bfd_close (nbfd);
- return NULL;
+ return NULL;
}
/* Open the next archived file. */
/* Pad to an even boundary...
Note that last_file->origin can be odd in the case of
- BSD-4.4-style element with a long odd size. */
+ BSD-4.4-style element with a long odd size. */
filestart = last_file->origin + size;
filestart += filestart % 2;
}
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
-
+
(PTR) &alpha_ecoff_backend_data
};
#ifdef ONLY_DECLARE_RELOCS
extern reloc_howto_type apollocoff_howto_table[];
#else
-reloc_howto_type apollocoff_howto_table[] =
+reloc_howto_type apollocoff_howto_table[] =
{
HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false),
HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false),
arelent *internal;
int relocentry;
{
- switch (relocentry)
+ switch (relocentry)
{
case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break;
case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break;
}
}
-int
+int
apollo_howto2rtype (internal)
reloc_howto_type *internal;
{
- if (internal->pc_relative)
+ if (internal->pc_relative)
{
- switch (internal->bitsize)
+ switch (internal->bitsize)
{
case 32: return R_PCRLONG;
case 16: return R_PCRWORD;
case 8: return R_RELBYTE;
}
}
- return R_RELLONG;
+ return R_RELLONG;
}
#endif /* not ONLY_DECLARE_RELOCS */
/* 4k pages */
#define COFF_PAGE_SIZE 0x1000
-/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */
+/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */
#define BSS_NOLOAD_IS_SHARED_LIBRARY
#define STATIC_RELOCS
#include "sysdep.h"
static boolean coff_m68k_aux_link_add_one_symbol
- PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
- asection *, bfd_vma, const char *, boolean, boolean,
+ PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
+ asection *, bfd_vma, const char *, boolean, boolean,
struct bfd_link_hash_entry **));
#define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
mirrors Apple's "solution" to let a static library symbol override
a shared library symbol. On the whole not a good thing, given how
shared libraries work here, but can work if you are careful with
- what you include in the shared object. */
+ what you include in the shared object. */
static boolean
coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,