* obj-coffbfd.c: use is a synonym for section, (do_relocs_for):

calc the base of relocs correctly.
	* tc-a29k.c (parse_operand): allow expressions to be in any section.
This commit is contained in:
Steve Chamberlain
1992-05-05 01:59:04 +00:00
parent e0047d4930
commit c58dbabf26
3 changed files with 101 additions and 102 deletions

View File

@ -1,3 +1,10 @@
Mon May 4 18:56:19 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* obj-coffbfd.c: use is a synonym for section, (do_relocs_for):
calc the base of relocs correctly.
* tc-a29k.c (parse_operand): allow expressions to be in any section.
Thu Mar 12 04:42:38 1992 K. Richard Pixley (rich@cygnus.com)
* tc-m68k.h, te-sun3.h: moved LOCAL_LABELS_FB definition from

View File

@ -155,6 +155,7 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "type", obj_coff_type, 0 },
{ "val", obj_coff_val, 0 },
{ "section", obj_coff_section, 0 },
{ "use", obj_coff_section, 0 },
{ "sect", obj_coff_section, 0 },
{ "text", obj_coff_text, 0 },
{ "data", obj_coff_data, 0 },
@ -317,7 +318,7 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
{
unsigned int nrelocs;
unsigned int idx;
unsigned int addr = 0;
for (idx = SEG_E0; idx < SEG_E9; idx++)
{
if (segment_info[idx].scnhdr.s_name[0])
@ -327,7 +328,7 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
struct external_reloc *external_reloc_vec;
unsigned int external_reloc_size;
unsigned int count = 0;
unsigned int base = segment_info[idx].scnhdr.s_paddr;
unsigned int base = addr;
fixS * fix_ptr = segment_info[idx].fix_root;
nrelocs = count_entries_in_chain(idx);
@ -420,6 +421,7 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
*file_cursor += external_reloc_size;
free( external_reloc_vec);
}
addr += segment_info[idx].scnhdr.s_size;
}
}
@ -1684,7 +1686,8 @@ extern void DEFUN_VOID(write_object_file)
/* THis is a special case, we leave the size alone, which will have */
/* been made up from all and any lcomms seen */
}
else {
else
{
addr += size_section(abfd, i);
}
}
@ -1714,6 +1717,8 @@ extern void DEFUN_VOID(write_object_file)
fill_section(abfd,&filehdr, &file_cursor);
filehdr.f_magic = COFF_MAGIC;
filehdr.f_timdat = time(0);
filehdr.f_flags = COFF_FLAGS ;
@ -1858,7 +1863,7 @@ DEFUN(c_line_new,(symbol, paddr, line_number, frag),
if (line_number == 0)
{
last_line_symbol = symbol;
last_line_symbol = symbol;
new_line->line.l_addr.l_symndx = (long)symbol;
}
else

View File

@ -80,7 +80,10 @@ const pseudo_typeS
{ "reg", s_lsym, 0 }, /* Register equate, same as equ */
{ "space", s_ignore, 0 }, /* Listing control */
{ "sect", s_ignore, 0 }, /* Creation of coff sections */
#ifndef OBJ_COFF
/* We can do this right with coff */
{ "use", s_use, 0 },
#endif
{ "word", cons, 4 },
{ NULL, 0, 0 },
};
@ -374,25 +377,9 @@ expressionS *operandp;
new = input_line_pointer;
input_line_pointer = save;
switch (seg) {
case SEG_ABSOLUTE:
case SEG_TEXT:
case SEG_DATA:
case SEG_BSS:
case SEG_UNKNOWN:
case SEG_DIFFERENCE:
case SEG_BIG:
case SEG_REGISTER:
return new;
case SEG_ABSENT:
if (seg == SEG_ABSENT)
as_bad("Missing operand");
return new;
default:
as_bad("Don't understand operand of type %s", segment_name (seg));
return new;
}
}
/* Instruction parsing. Takes a string containing the opcode.