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.
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.
{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 ();
}
/* 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
/* 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
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
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. */