* config/obj-som.c (obj_som_version): Pass version string to

SOM BFD backend.
        (obj_som_copyright): New function.  Much like obj_som_version.

        * config/tc-hppa.c (obj_copyright): Define as appropriate for
        SOM and ELF.
        (pa_copyright): Just a stub now.
This commit is contained in:
Jeff Law 1993-12-06 08:55:06 +00:00
parent f6c2300b0a
commit eb91665b4c
3 changed files with 85 additions and 37 deletions

View File

@ -1,5 +1,13 @@
Sun Dec 5 17:05:29 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
* config/obj-som.c (obj_som_version): Pass version string to
SOM BFD backend.
(obj_som_copyright): New function. Much like obj_som_version.
* config/tc-hppa.c (obj_copyright): Define as appropriate for
SOM and ELF.
(pa_copyright): Just a stub now.
* config/obj-som.c (obj_read_begin_hook): Delete unused function.
* config/obj-som.h (obj_read_begin_hook): Provide dummy definition.
(TARGET_SYMBOL_FIELDS): Delete. SOM isn't making use of them.

View File

@ -32,24 +32,84 @@ const pseudo_typeS obj_pseudo_table[] =
{NULL}
};
/* Handle a .version directive. FIXME. We just parse the .version
directive and throw away the results!. */
static int version_seen = 0;
static int copyright_seen = 0;
/* Handle a .version directive. */
void
obj_som_version (unused)
int unused;
{
char *version, c;
if (version_seen)
{
as_bad ("Only one .version pseudo-op per file!");
ignore_rest_of_line ();
return;
}
SKIP_WHITESPACE ();
if (*input_line_pointer == '\"')
{
version = input_line_pointer;
++input_line_pointer;
while (is_a_char (next_char_of_string ()))
;
c = *input_line_pointer;
*input_line_pointer = '\000';
}
else
{
as_bad ("Expected quoted string");
ignore_rest_of_line ();
return;
}
version_seen = 1;
bfd_som_attach_aux_hdr (stdoutput, VERSION_AUX_ID, version);
*input_line_pointer = c;
demand_empty_rest_of_line ();
}
/* Handle a .copyright directive. This probably isn't complete, but
it's of dubious value anyway and (IMHO) not worth the time to finish.
If you care about copyright strings that much, you fix it. */
void
obj_som_copyright (unused)
int unused;
{
char *copyright, c;
if (copyright_seen)
{
as_bad ("Only one .copyright pseudo-op per file!");
ignore_rest_of_line ();
return;
}
SKIP_WHITESPACE ();
if (*input_line_pointer == '\"')
{
copyright = input_line_pointer;
++input_line_pointer;
while (is_a_char (next_char_of_string ()))
;
c = *input_line_pointer;
*input_line_pointer = '\000';
}
else
{
as_bad ("Expected quoted string");
ignore_rest_of_line ();
return;
}
copyright_seen = 1;
bfd_som_attach_aux_hdr (stdoutput, COPYRIGHT_AUX_ID, copyright);
*input_line_pointer = c;
demand_empty_rest_of_line ();
}

View File

@ -52,8 +52,10 @@ typedef elf_symbol_type obj_symbol_type;
/* How to generate a relocation. */
#define hppa_gen_reloc_type hppa_elf_gen_reloc_type
/* Who knows. */
/* ELF objects can have versions, but apparently do not have anywhere
to store a copyright string. */
#define obj_version obj_elf_version
#define obj_copyright obj_elf_version
/* Use space aliases. */
#define USE_ALIASES 1
@ -73,8 +75,9 @@ static void hppa_tc_make_symextn_section PARAMS ((void));
/* Object file formats specify relocation types. */
typedef int reloc_type;
/* Who knows. */
/* SOM objects can have both a version string and a copyright string. */
#define obj_version obj_som_version
#define obj_copyright obj_som_copyright
/* Do not use space aliases. */
#define USE_ALIASES 0
@ -4459,39 +4462,6 @@ pa_comm (unused)
demand_empty_rest_of_line ();
}
/* Process a .COPYRIGHT pseudo-op. */
static void
pa_copyright (unused)
int unused;
{
char *name;
char c;
SKIP_WHITESPACE ();
if (*input_line_pointer == '\"')
{
++input_line_pointer;
name = input_line_pointer;
while ((c = next_char_of_string ()) >= 0)
;
c = *input_line_pointer;
*input_line_pointer = '\0';
*(input_line_pointer - 1) = '\0';
{
/* FIXME. Not supported */
abort ();
}
*input_line_pointer = c;
}
else
{
as_bad ("Expected \"-ed string");
}
pa_undefine_label ();
demand_empty_rest_of_line ();
}
/* Process a .END pseudo-op. */
static void
@ -6176,6 +6146,16 @@ pa_version (unused)
pa_undefine_label ();
}
/* Handle a .COPYRIGHT pseudo-op. */
static void
pa_copyright (unused)
int unused;
{
obj_copyright (0);
pa_undefine_label ();
}
/* Just like a normal cons, but when finished we have to undefine
the latest space label. */