mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 02:53:48 +08:00
*** empty log message ***
This commit is contained in:
parent
ad19c0a2d1
commit
de7c1ff613
@ -357,6 +357,13 @@ coff_real_object_p(abfd, nscns, opthdr)
|
|||||||
abfd->obj_machine = 68020;
|
abfd->obj_machine = 68020;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MC88MAGIC
|
||||||
|
case MC88MAGIC:
|
||||||
|
case MC88DMAGIC:
|
||||||
|
abfd->obj_arch = bfd_arch_m88k;
|
||||||
|
abfd->obj_machine = 88100;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef I960ROMAGIC
|
#ifdef I960ROMAGIC
|
||||||
case I960ROMAGIC:
|
case I960ROMAGIC:
|
||||||
case I960RWMAGIC:
|
case I960RWMAGIC:
|
||||||
@ -1126,9 +1133,9 @@ coff_set_flags(abfd, magicp, flagsp)
|
|||||||
*magicp = MC68MAGIC;
|
*magicp = MC68MAGIC;
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
#if M88DMAGIC
|
#ifdef M88MAGIC
|
||||||
case bfd_arch_m88k:
|
case bfd_arch_m88k:
|
||||||
*magicp = MC88DMAGIC;
|
*magicp = MC88MAGIC;
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -1711,7 +1718,7 @@ get_normalized_symtab(abfd)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((((AUXENT *) (retval + 1))->x_file.x_n.x_offset
|
if ((((AUXENT *) (retval + 1))->x_file.x_n.x_offset
|
||||||
= (int) malloc(namelength)) == NULL) {
|
= (int) malloc(namelength+1)) == NULL) {
|
||||||
bfd_error = no_memory;
|
bfd_error = no_memory;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
} /* on error */
|
} /* on error */
|
||||||
@ -1740,7 +1747,6 @@ get_normalized_symtab(abfd)
|
|||||||
/* ...and normalize symbol names. */
|
/* ...and normalize symbol names. */
|
||||||
|
|
||||||
for (s = retval + obj_symbol_slew(abfd); s < end; ++s) {
|
for (s = retval + obj_symbol_slew(abfd); s < end; ++s) {
|
||||||
|
|
||||||
if (s->n_zeroes != 0) {
|
if (s->n_zeroes != 0) {
|
||||||
/*
|
/*
|
||||||
This is a "short" name. Make it long.
|
This is a "short" name. Make it long.
|
||||||
@ -1763,7 +1769,7 @@ get_normalized_symtab(abfd)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
} /* on error */
|
} /* on error */
|
||||||
bzero(newstring, i);
|
bzero(newstring, i);
|
||||||
strncpy(newstring, s->n_name, 8);
|
strncpy(newstring, s->n_name, i -1 );
|
||||||
s->n_offset = (int) newstring;
|
s->n_offset = (int) newstring;
|
||||||
s->n_zeroes = 0;
|
s->n_zeroes = 0;
|
||||||
|
|
||||||
|
219
bfd/oasys.c
219
bfd/oasys.c
@ -1,3 +1,4 @@
|
|||||||
|
/*#define UNDERSCORE_HACK 0*/
|
||||||
/*
|
/*
|
||||||
|
|
||||||
bfd backend for oasys objects.
|
bfd backend for oasys objects.
|
||||||
@ -90,7 +91,13 @@ bfd *abfd;
|
|||||||
/* Buy enough memory for all the symbols and all the names */
|
/* Buy enough memory for all the symbols and all the names */
|
||||||
data->symbols =
|
data->symbols =
|
||||||
(asymbol *)malloc(sizeof(asymbol) * abfd->symcount);
|
(asymbol *)malloc(sizeof(asymbol) * abfd->symcount);
|
||||||
|
#ifdef UNDERSCORE_HACK
|
||||||
|
/* buy 1 more char for each symbol to keep the underscore in*/
|
||||||
|
data->strings = malloc(data->symbol_string_length +
|
||||||
|
abfd->symcount);
|
||||||
|
#else
|
||||||
data->strings = malloc(data->symbol_string_length);
|
data->strings = malloc(data->symbol_string_length);
|
||||||
|
#endif
|
||||||
|
|
||||||
dest_undefined = data->symbols;
|
dest_undefined = data->symbols;
|
||||||
dest_defined = data->symbols + abfd->symcount -1;
|
dest_defined = data->symbols + abfd->symcount -1;
|
||||||
@ -98,6 +105,7 @@ bfd *abfd;
|
|||||||
string_ptr = data->strings;
|
string_ptr = data->strings;
|
||||||
bfd_seek(abfd, (file_ptr)0, SEEK_SET);
|
bfd_seek(abfd, (file_ptr)0, SEEK_SET);
|
||||||
while (loop) {
|
while (loop) {
|
||||||
|
|
||||||
oasys_read_record(abfd, &record);
|
oasys_read_record(abfd, &record);
|
||||||
switch (record.header.type) {
|
switch (record.header.type) {
|
||||||
case oasys_record_is_header_enum:
|
case oasys_record_is_header_enum:
|
||||||
@ -105,12 +113,16 @@ bfd *abfd;
|
|||||||
case oasys_record_is_local_enum:
|
case oasys_record_is_local_enum:
|
||||||
case oasys_record_is_symbol_enum:
|
case oasys_record_is_symbol_enum:
|
||||||
{
|
{
|
||||||
|
int flag = record.header.type == oasys_record_is_local_enum ?
|
||||||
|
(BSF_LOCAL) : (BSF_GLOBAL | BSF_EXPORT);
|
||||||
|
|
||||||
|
|
||||||
size_t length = oasys_string_length(&record);
|
size_t length = oasys_string_length(&record);
|
||||||
switch (record.symbol.relb[0] & RELOCATION_TYPE_BITS) {
|
switch (record.symbol.relb[0] & RELOCATION_TYPE_BITS) {
|
||||||
case RELOCATION_TYPE_ABS:
|
case RELOCATION_TYPE_ABS:
|
||||||
dest = dest_defined--;
|
dest = dest_defined--;
|
||||||
dest->section = 0;
|
dest->section = 0;
|
||||||
dest->flags = BSF_ABSOLUTE | BSF_EXPORT | BSF_GLOBAL;
|
dest->flags = BSF_ABSOLUTE | flag;
|
||||||
break;
|
break;
|
||||||
case RELOCATION_TYPE_REL:
|
case RELOCATION_TYPE_REL:
|
||||||
dest = dest_defined--;
|
dest = dest_defined--;
|
||||||
@ -119,11 +131,11 @@ bfd *abfd;
|
|||||||
RELOCATION_SECT_BITS];
|
RELOCATION_SECT_BITS];
|
||||||
if (record.header.type == oasys_record_is_local_enum)
|
if (record.header.type == oasys_record_is_local_enum)
|
||||||
{
|
{
|
||||||
dest->flags = BSF_LOCAL;
|
dest->flags = BSF_LOCAL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
dest->flags = BSF_EXPORT | BSF_GLOBAL;
|
dest->flags = flag;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RELOCATION_TYPE_UND:
|
case RELOCATION_TYPE_UND:
|
||||||
@ -142,9 +154,15 @@ bfd *abfd;
|
|||||||
}
|
}
|
||||||
dest->name = string_ptr;
|
dest->name = string_ptr;
|
||||||
dest->the_bfd = abfd;
|
dest->the_bfd = abfd;
|
||||||
|
dest->udata = (void *)NULL;
|
||||||
dest->value = bfd_h_getlong(abfd, &record.symbol.value);
|
dest->value = bfd_h_getlong(abfd, &record.symbol.value);
|
||||||
|
#if UNDERSCORE_HACK
|
||||||
|
string_ptr[0] = '_';
|
||||||
|
string_ptr++;
|
||||||
|
#endif
|
||||||
memcpy(string_ptr, record.symbol.name, length);
|
memcpy(string_ptr, record.symbol.name, length);
|
||||||
|
|
||||||
|
|
||||||
string_ptr[length] =0;
|
string_ptr[length] =0;
|
||||||
string_ptr += length +1;
|
string_ptr += length +1;
|
||||||
}
|
}
|
||||||
@ -163,8 +181,7 @@ bfd *abfd;
|
|||||||
{
|
{
|
||||||
oasys_slurp_symbol_table (abfd);
|
oasys_slurp_symbol_table (abfd);
|
||||||
|
|
||||||
return (abfd->symcount != 0) ?
|
return (abfd->symcount+1) * (sizeof (oasys_symbol_type *));
|
||||||
(abfd->symcount+1) * (sizeof (oasys_symbol_type *)) : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -289,10 +306,12 @@ bfd *abfd;
|
|||||||
/* Inspect the records, but only keep the section info -
|
/* Inspect the records, but only keep the section info -
|
||||||
remember the size of the symbols
|
remember the size of the symbols
|
||||||
*/
|
*/
|
||||||
|
static_data.first_data_record = 0;
|
||||||
while (loop) {
|
while (loop) {
|
||||||
|
|
||||||
oasys_record_union_type record;
|
oasys_record_union_type record;
|
||||||
oasys_read_record(abfd, &record);
|
oasys_read_record(abfd, &record);
|
||||||
if (record.header.length < sizeof(record.header))
|
if (record.header.length < sizeof(record.header))
|
||||||
return (bfd_target *)NULL;
|
return (bfd_target *)NULL;
|
||||||
|
|
||||||
switch ((oasys_record_enum_type)(record.header.type)) {
|
switch ((oasys_record_enum_type)(record.header.type)) {
|
||||||
@ -429,6 +448,7 @@ bfd *abfd;
|
|||||||
per->reloc_tail_ptr = (oasys_reloc_type **)&(s->relocation);
|
per->reloc_tail_ptr = (oasys_reloc_type **)&(s->relocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->first_data_record == 0) return true;
|
||||||
bfd_seek(abfd, data->first_data_record, SEEK_SET);
|
bfd_seek(abfd, data->first_data_record, SEEK_SET);
|
||||||
while (loop) {
|
while (loop) {
|
||||||
oasys_read_record(abfd, &record);
|
oasys_read_record(abfd, &record);
|
||||||
@ -436,93 +456,112 @@ bfd *abfd;
|
|||||||
case oasys_record_is_header_enum:
|
case oasys_record_is_header_enum:
|
||||||
break;
|
break;
|
||||||
case oasys_record_is_data_enum:
|
case oasys_record_is_data_enum:
|
||||||
{
|
{
|
||||||
|
|
||||||
uint8e_type *src = record.data.data;
|
uint8e_type *src = record.data.data;
|
||||||
uint8e_type *end_src = ((uint8e_type *)&record) + record.header.length;
|
uint8e_type *end_src = ((uint8e_type *)&record) +
|
||||||
unsigned int relbit;
|
record.header.length;
|
||||||
bfd_byte *dst_ptr ;
|
unsigned int relbit;
|
||||||
bfd_byte *dst_base_ptr ;
|
bfd_byte *dst_ptr ;
|
||||||
asection *section;
|
bfd_byte *dst_base_ptr ;
|
||||||
unsigned int count;
|
asection *section;
|
||||||
|
unsigned int count;
|
||||||
|
|
||||||
bfd_vma dst_offset = bfd_h_getlong(abfd, record.data.addr);
|
bfd_vma dst_offset = bfd_h_getlong(abfd, record.data.addr);
|
||||||
section = data->sections[record.data.relb & RELOCATION_SECT_BITS];
|
section = data->sections[record.data.relb & RELOCATION_SECT_BITS];
|
||||||
per = oasys_per_section(section);
|
per = oasys_per_section(section);
|
||||||
dst_base_ptr = dst_ptr = oasys_per_section(section)->data + dst_offset;
|
dst_base_ptr = oasys_per_section(section)->data;
|
||||||
|
dst_ptr = oasys_per_section(section)->data +
|
||||||
|
dst_offset;
|
||||||
|
|
||||||
while (src < end_src) {
|
while (src < end_src) {
|
||||||
uint8e_type mod_byte = *src++;
|
uint32_type gap = end_src - src -1;
|
||||||
count = 8;
|
uint8e_type mod_byte = *src++;
|
||||||
|
count = 8;
|
||||||
for (relbit = 1; count-- != 0; relbit <<=1)
|
if (mod_byte == 0 && gap >= 8) {
|
||||||
{
|
dst_ptr[0] = src[0];
|
||||||
if (relbit & mod_byte)
|
dst_ptr[1] = src[1];
|
||||||
{
|
dst_ptr[2] = src[2];
|
||||||
uint8e_type reloc = *src;
|
dst_ptr[3] = src[3];
|
||||||
/* This item needs to be relocated */
|
dst_ptr[4] = src[4];
|
||||||
switch (reloc & RELOCATION_TYPE_BITS) {
|
dst_ptr[5] = src[5];
|
||||||
case RELOCATION_TYPE_ABS:
|
dst_ptr[6] = src[6];
|
||||||
|
dst_ptr[7] = src[7];
|
||||||
break;
|
dst_ptr+= 8;
|
||||||
|
src += 8;
|
||||||
case RELOCATION_TYPE_REL:
|
|
||||||
{
|
|
||||||
/* Relocate the item relative to the section */
|
|
||||||
oasys_reloc_type *r =
|
|
||||||
(oasys_reloc_type *)
|
|
||||||
obstack_alloc(&per->reloc_obstack,
|
|
||||||
sizeof(oasys_reloc_type));
|
|
||||||
*(per->reloc_tail_ptr) = r;
|
|
||||||
per->reloc_tail_ptr = &r->next;
|
|
||||||
r->next= (oasys_reloc_type *)NULL;
|
|
||||||
/* Reference to undefined symbol */
|
|
||||||
src++;
|
|
||||||
/* There is no symbol */
|
|
||||||
r->symbol = 0;
|
|
||||||
/* Work out the howto */
|
|
||||||
r->relent.section =
|
|
||||||
data->sections[reloc & RELOCATION_SECT_BITS];
|
|
||||||
r->relent.addend = 0;
|
|
||||||
r->relent.address = dst_ptr - dst_base_ptr;
|
|
||||||
r->relent.howto = &howto_table[reloc>>6];
|
|
||||||
section->reloc_count++;
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
case RELOCATION_TYPE_UND:
|
|
||||||
{
|
|
||||||
oasys_reloc_type *r =
|
|
||||||
(oasys_reloc_type *)
|
|
||||||
obstack_alloc(&per->reloc_obstack,
|
|
||||||
sizeof(oasys_reloc_type));
|
|
||||||
*(per->reloc_tail_ptr) = r;
|
|
||||||
per->reloc_tail_ptr = &r->next;
|
|
||||||
r->next= (oasys_reloc_type *)NULL;
|
|
||||||
/* Reference to undefined symbol */
|
|
||||||
src++;
|
|
||||||
/* Get symbol number */
|
|
||||||
r->symbol = (src[0]<<8) | src[1];
|
|
||||||
/* Work out the howto */
|
|
||||||
r->relent.section = (asection *)NULL;
|
|
||||||
r->relent.addend = 0;
|
|
||||||
r->relent.address = dst_ptr - dst_base_ptr;
|
|
||||||
r->relent.howto = &howto_table[reloc>>6];
|
|
||||||
|
|
||||||
section->reloc_count++;
|
|
||||||
src+=2;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RELOCATION_TYPE_COM:
|
|
||||||
BFD_FAIL();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*dst_ptr++ = *src++;
|
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
}
|
for (relbit = 1; count-- != 0 && gap != 0; gap --, relbit <<=1)
|
||||||
|
{
|
||||||
|
if (relbit & mod_byte)
|
||||||
|
{
|
||||||
|
uint8e_type reloc = *src;
|
||||||
|
/* This item needs to be relocated */
|
||||||
|
switch (reloc & RELOCATION_TYPE_BITS) {
|
||||||
|
case RELOCATION_TYPE_ABS:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RELOCATION_TYPE_REL:
|
||||||
|
{
|
||||||
|
/* Relocate the item relative to the section */
|
||||||
|
oasys_reloc_type *r =
|
||||||
|
(oasys_reloc_type *)
|
||||||
|
obstack_alloc(&per->reloc_obstack,
|
||||||
|
sizeof(oasys_reloc_type));
|
||||||
|
*(per->reloc_tail_ptr) = r;
|
||||||
|
per->reloc_tail_ptr = &r->next;
|
||||||
|
r->next= (oasys_reloc_type *)NULL;
|
||||||
|
/* Reference to undefined symbol */
|
||||||
|
src++;
|
||||||
|
/* There is no symbol */
|
||||||
|
r->symbol = 0;
|
||||||
|
/* Work out the howto */
|
||||||
|
r->relent.section =
|
||||||
|
data->sections[reloc & RELOCATION_SECT_BITS];
|
||||||
|
r->relent.addend = 0;
|
||||||
|
r->relent.address = dst_ptr - dst_base_ptr;
|
||||||
|
r->relent.howto = &howto_table[reloc>>6];
|
||||||
|
r->relent.sym_ptr_ptr = (asymbol **)NULL;
|
||||||
|
section->reloc_count++;
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case RELOCATION_TYPE_UND:
|
||||||
|
{
|
||||||
|
oasys_reloc_type *r =
|
||||||
|
(oasys_reloc_type *)
|
||||||
|
obstack_alloc(&per->reloc_obstack,
|
||||||
|
sizeof(oasys_reloc_type));
|
||||||
|
*(per->reloc_tail_ptr) = r;
|
||||||
|
per->reloc_tail_ptr = &r->next;
|
||||||
|
r->next= (oasys_reloc_type *)NULL;
|
||||||
|
/* Reference to undefined symbol */
|
||||||
|
src++;
|
||||||
|
/* Get symbol number */
|
||||||
|
r->symbol = (src[0]<<8) | src[1];
|
||||||
|
/* Work out the howto */
|
||||||
|
r->relent.section = (asection *)NULL;
|
||||||
|
r->relent.addend = 0;
|
||||||
|
r->relent.address = dst_ptr - dst_base_ptr;
|
||||||
|
r->relent.howto = &howto_table[reloc>>6];
|
||||||
|
r->relent.sym_ptr_ptr = (asymbol **)NULL;
|
||||||
|
|
||||||
|
section->reloc_count++;
|
||||||
|
src+=2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RELOCATION_TYPE_COM:
|
||||||
|
BFD_FAIL();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*dst_ptr++ = *src++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case oasys_record_is_local_enum:
|
case oasys_record_is_local_enum:
|
||||||
case oasys_record_is_symbol_enum:
|
case oasys_record_is_symbol_enum:
|
||||||
|
@ -37,6 +37,7 @@ extern bfd_target ieee_vec;
|
|||||||
extern bfd_target oasys_vec;
|
extern bfd_target oasys_vec;
|
||||||
extern bfd_target m88k_bcs_vec;
|
extern bfd_target m88k_bcs_vec;
|
||||||
|
|
||||||
|
vvvvvvvvvvvvvvvvvvvv
|
||||||
bfd_target *target_vector[] = {
|
bfd_target *target_vector[] = {
|
||||||
&aout_little_vec,
|
&aout_little_vec,
|
||||||
&ieee_vec,
|
&ieee_vec,
|
||||||
@ -50,3 +51,4 @@ bfd_target *target_vector[] = {
|
|||||||
&srec_vec,
|
&srec_vec,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
48
ld/Makefile
48
ld/Makefile
@ -3,8 +3,8 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
srcdir = ../common
|
srcdir=../common
|
||||||
VPATH = ../common
|
VPATH=../common
|
||||||
BASEDIR = ../..
|
BASEDIR = ../..
|
||||||
HOSTDIR = ../$(HOST)/
|
HOSTDIR = ../$(HOST)/
|
||||||
INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus
|
INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus
|
||||||
@ -14,9 +14,20 @@ DEBUG = -g
|
|||||||
|
|
||||||
#__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS
|
#__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS
|
||||||
#__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS
|
#__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS
|
||||||
|
#__dgux__#EXTRA_DEF=-DHOST_SYS=DGUX_SYS
|
||||||
|
|
||||||
CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG)
|
CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG)
|
||||||
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
|
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
|
||||||
|
|
||||||
|
.SUFFIXES: .y
|
||||||
|
|
||||||
|
.y.o:
|
||||||
|
yacc -tvd $<
|
||||||
|
mv y.tab.c ldgram.tab.c
|
||||||
|
$(CC) -c $(CFLAGS) ldgram.tab.c
|
||||||
|
mv ldgram.tab.o ldgram.o
|
||||||
|
|
||||||
|
|
||||||
# go directly to ld.new in case this ld isn't capable of
|
# go directly to ld.new in case this ld isn't capable of
|
||||||
# linking native object on this host. It can be renamed on
|
# linking native object on this host. It can be renamed on
|
||||||
# install.
|
# install.
|
||||||
@ -25,7 +36,7 @@ PROGS = $(HOSTDIR)/ld.new
|
|||||||
# for self hosting
|
# for self hosting
|
||||||
GNUTARGET=a.out-generic-big
|
GNUTARGET=a.out-generic-big
|
||||||
LDEMULATION=gld
|
LDEMULATION=gld
|
||||||
bfdlib=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a
|
BFDLIB=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a
|
||||||
|
|
||||||
OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
|
OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
|
||||||
ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o
|
ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o
|
||||||
@ -57,32 +68,27 @@ $(BFDLIB): $(BFDSOURCES)
|
|||||||
|
|
||||||
$(PROGS): $(OBJS) $(BFDLIB)
|
$(PROGS): $(OBJS) $(BFDLIB)
|
||||||
# (cd ../bfd; make)
|
# (cd ../bfd; make)
|
||||||
# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(bfdlib) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
||||||
# gld -o ld /lib/crt0.o $(OBJS) $(bfdlib) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
# gld -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
||||||
$(CC) -Bstatic -o ld.new $(OBJS) $(bfdlib)
|
$(CC) -Bstatic -o ld.new $(OBJS) $(BFDLIB)
|
||||||
|
|
||||||
|
|
||||||
ld1: ld
|
ld1: ld
|
||||||
gcc -v -B./ -o ld1 $(OBJS) $(bfdlib)
|
gcc -v -B./ -o ld1 $(OBJS) $(BFDLIB)
|
||||||
|
|
||||||
ld2: ld1
|
ld2: ld1
|
||||||
mv ld1 ld
|
mv ld1 ld
|
||||||
gcc -v -B./ -o ld2 $(OBJS) $(bfdlib)
|
gcc -v -B./ -o ld2 $(OBJS) $(BFDLIB)
|
||||||
|
|
||||||
ld3: ld2
|
ld3: ld2
|
||||||
mv ld2 ld
|
mv ld2 ld
|
||||||
gcc -v -B./ -o ld3 $(OBJS) $(bfdlib)
|
gcc -v -B./ -o ld3 $(OBJS) $(BFDLIB)
|
||||||
|
|
||||||
ld.dvi:ld.tex
|
ld.dvi:ld.tex
|
||||||
tex ld.tex
|
tex ld.tex
|
||||||
|
|
||||||
ldgram.o:ldgram.y
|
ldgram.o: ldgram.y
|
||||||
yacc -d ldgram.y
|
ldgram.tab.h:ldgram.y
|
||||||
mv y.tab.c ldgram.tab.c
|
|
||||||
$(CC) -c $(CFLAGS) ldgram.tab.c
|
|
||||||
mv ldgram.tab.o ldgram.o
|
|
||||||
|
|
||||||
ldgram.tab.h:y.tab.h
|
|
||||||
cp y.tab.h ldgram.tab.h
|
cp y.tab.h ldgram.tab.h
|
||||||
|
|
||||||
ldlex.c: ldlex.l ldgram.tab.h
|
ldlex.c: ldlex.l ldgram.tab.h
|
||||||
@ -96,11 +102,11 @@ ldlang.o: ldlang.c ldgram.tab.h
|
|||||||
ld-gld.o: ld-gld.c
|
ld-gld.o: ld-gld.c
|
||||||
ld-gld68k.o: ld-gld68k.c
|
ld-gld68k.o: ld-gld68k.c
|
||||||
ld-gld960.o: ld-gld960.c
|
ld-gld960.o: ld-gld960.c
|
||||||
ld-emul.o:ld-emul.c
|
ld-emul.o: ld-emul.c
|
||||||
ld-lnk960.o:ld-lnk960.c
|
ld-lnk960.o: ld-lnk960.c
|
||||||
ldexp.o:ldexp.c ldgram.tab.h
|
ldexp.o: ldexp.c ldgram.tab.h
|
||||||
ldmisc.o:ldmisc.c
|
ldmisc.o: ldmisc.c
|
||||||
ldsym.o:ldsym.c
|
ldsym.o: ldsym.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
- rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
|
- rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
|
||||||
|
@ -119,7 +119,7 @@ char *target;
|
|||||||
ld_emulation = &ld_gld960_emulation;
|
ld_emulation = &ld_gld960_emulation;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
info("%P%F unrecognised emulation mode: %s",target);
|
info("%P%F unrecognised emulation mode: %s\n",target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 1991/03/22 23:02:31 steve
|
Revision 1.3 1991/04/08 23:21:26 steve
|
||||||
Brought up to sync with Intel again.
|
*** empty log message ***
|
||||||
|
|
||||||
|
* Revision 1.2 1991/03/22 23:02:31 steve
|
||||||
|
* Brought up to sync with Intel again.
|
||||||
|
*
|
||||||
* Revision 1.2 1991/03/15 18:45:55 rich
|
* Revision 1.2 1991/03/15 18:45:55 rich
|
||||||
* foo
|
* foo
|
||||||
*
|
*
|
||||||
@ -199,10 +202,13 @@ lnk960_before_allocation()
|
|||||||
static void
|
static void
|
||||||
lnk960_after_allocation()
|
lnk960_after_allocation()
|
||||||
{
|
{
|
||||||
lang_abs_symbol_at_end_of(".text","_etext");
|
extern ld_config_type config;
|
||||||
lang_abs_symbol_at_end_of(".data","_edata");
|
if (config.relocateable_output == false) {
|
||||||
lang_abs_symbol_at_beginning_of(".bss","_bss_start");
|
lang_abs_symbol_at_end_of(".text","_etext");
|
||||||
lang_abs_symbol_at_end_of(".bss","_end");
|
lang_abs_symbol_at_end_of(".data","_edata");
|
||||||
|
lang_abs_symbol_at_beginning_of(".bss","_bss_start");
|
||||||
|
lang_abs_symbol_at_end_of(".bss","_end");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
|
13
ld/ldgram.y
13
ld/ldgram.y
@ -225,10 +225,10 @@ command_line_option:
|
|||||||
{
|
{
|
||||||
force_make_executable = true;
|
force_make_executable = true;
|
||||||
}
|
}
|
||||||
| OPTION_d {
|
| OPTION_d {
|
||||||
command_line.force_common_definition = true;
|
command_line.force_common_definition = true;
|
||||||
}
|
}
|
||||||
| OPTION_dc
|
| OPTION_dc
|
||||||
{
|
{
|
||||||
command_line.force_common_definition = true;
|
command_line.force_common_definition = true;
|
||||||
}
|
}
|
||||||
@ -236,16 +236,17 @@ command_line_option:
|
|||||||
{
|
{
|
||||||
/* Ignored */
|
/* Ignored */
|
||||||
}
|
}
|
||||||
| OPTION_dp
|
| OPTION_dp
|
||||||
{
|
{
|
||||||
command_line.force_common_definition = true;
|
command_line.force_common_definition = true;
|
||||||
}
|
}
|
||||||
| OPTION_format NAME
|
| OPTION_format NAME
|
||||||
{
|
{
|
||||||
lang_add_target($2);
|
lang_add_target($2);
|
||||||
}
|
}
|
||||||
|
|
||||||
| OPTION_Texp { hex_mode =true; }
|
| OPTION_Texp
|
||||||
|
{ hex_mode =true; }
|
||||||
exp
|
exp
|
||||||
{ lang_section_start($1, $3);
|
{ lang_section_start($1, $3);
|
||||||
hex_mode = false; }
|
hex_mode = false; }
|
||||||
@ -290,9 +291,11 @@ command_line_option:
|
|||||||
| OPTION_defsym
|
| OPTION_defsym
|
||||||
{
|
{
|
||||||
ldgram_in_defsym = true;
|
ldgram_in_defsym = true;
|
||||||
|
hex_mode = true;
|
||||||
}
|
}
|
||||||
assignment
|
assignment
|
||||||
{
|
{
|
||||||
|
hex_mode = false;
|
||||||
ldgram_in_defsym = false;
|
ldgram_in_defsym = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
47
ld/ldlang.c
47
ld/ldlang.c
@ -18,53 +18,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* $Id$
|
/* $Id$
|
||||||
*
|
*
|
||||||
* $Log$
|
|
||||||
* Revision 1.4 1991/03/27 02:29:22 steve
|
|
||||||
* *** empty log message ***
|
|
||||||
*
|
|
||||||
* Revision 1.3 1991/03/27 00:52:49 steve
|
|
||||||
* *** empty log message ***
|
|
||||||
*
|
|
||||||
* Revision 1.2 1991/03/22 23:02:34 steve
|
|
||||||
* Brought up to sync with Intel again.
|
|
||||||
*
|
|
||||||
* Revision 1.3 1991/03/16 22:19:21 rich
|
|
||||||
* pop
|
|
||||||
*
|
|
||||||
* Revision 1.2 1991/03/15 18:52:42 rich
|
|
||||||
* pop
|
|
||||||
*
|
|
||||||
* Revision 1.1 1991/03/13 00:48:23 chrisb
|
|
||||||
* Initial revision
|
|
||||||
*
|
|
||||||
* Revision 1.8 1991/03/10 09:31:28 rich
|
|
||||||
* Modified Files:
|
|
||||||
* Makefile config.h ld-emul.c ld-emul.h ld-gld.c ld-gld960.c
|
|
||||||
* ld-lnk960.c ld.h lddigest.c ldexp.c ldexp.h ldfile.c ldfile.h
|
|
||||||
* ldgram.y ldinfo.h ldlang.c ldlang.h ldlex.h ldlex.l ldmain.c
|
|
||||||
* ldmain.h ldmisc.c ldmisc.h ldsym.c ldsym.h ldversion.c
|
|
||||||
* ldversion.h ldwarn.h ldwrite.c ldwrite.h y.tab.h
|
|
||||||
*
|
|
||||||
* As of this round of changes, ld now builds on all hosts of (Intel960)
|
|
||||||
* interest and copy passes my copy test on big endian hosts again.
|
|
||||||
*
|
|
||||||
* Revision 1.7 1991/03/09 03:31:03 sac
|
|
||||||
* After a fatal info message, the output file is deleted.
|
|
||||||
*
|
|
||||||
* Revision 1.6 1991/03/09 03:25:06 sac
|
|
||||||
* Added support for LONG, SHORT and BYTE keywords in scripts
|
|
||||||
*
|
|
||||||
* Revision 1.5 1991/03/06 21:59:31 sac
|
|
||||||
* Completed G++ support
|
|
||||||
*
|
|
||||||
* Revision 1.4 1991/03/06 02:26:02 sac
|
|
||||||
* Added support for constructor sections.
|
|
||||||
* Remove parsing ambiguity.
|
|
||||||
* Lint
|
|
||||||
*
|
|
||||||
* Revision 1.3 1991/02/22 17:15:01 sac
|
|
||||||
* Added RCS keywords and copyrights
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user