[PATCH v1 1/1] gas: microblaze: Add mlittle-endian and mbig-endian flags
Nick Clifton
nickc@redhat.com
Wed Sep 27 14:00:35 GMT 2023
Hi Neal,
> Added support in gas for mlittle-endian and mbig-endian flags
> as options.
Thanks for contributing this patch. There are a few things however
that need to be fixed/tidied up:
> #define OPTION_EB (OPTION_MD_BASE + 0)
> #define OPTION_EL (OPTION_MD_BASE + 1)
> +#define OPTION_LITTLE (OPTION_MD_BASE + 2)
> +#define OPTION_BIG (OPTION_MD_BASE + 3)
There is no need to have new values for the new options, you
can just reuse the existing ones. ie:
> @@ -1854,6 +1856,8 @@ struct option md_longopts[] =
> {
> {"EB", no_argument, NULL, OPTION_EB},
> {"EL", no_argument, NULL, OPTION_EL},
> + {"mlittle-endian", no_argument, NULL, OPTION_LITTLE},
> + {"mbig-endian", no_argument, NULL, OPTION_BIG},
> { NULL, no_argument, NULL, 0}
> };
Change this to:
> {"EB", no_argument, NULL, OPTION_EB},
> {"EL", no_argument, NULL, OPTION_EL},
> + {"mlittle-endian", no_argument, NULL, OPTION_EL},
> + {"mbig-endian", no_argument, NULL, OPTION_EB},
> { NULL, no_argument, NULL, 0}
> };
Then you can also delete:
> @@ -2507,9 +2511,11 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
> switch (c)
> {
> case OPTION_EB:
> + case OPTION_BIG:
> target_big_endian = 1;
> break;
> case OPTION_EL:
> + case OPTION_LITTLE:
> target_big_endian = 0;
> break;
> default:
As this change is no longer needed.
More importantly however, since you are adding new MicroBlaze specific
command line options you need to update the gas/doc/as.texi file to
mention them (search for "Target MICROBLAZE options") and the
gas/doc/c-microblaze.texi file to add a "MicroBlaze Options" node.
Cheers
Nick
More information about the Binutils
mailing list