PATCH: bfd/som.c for R_COMMENT

RDBrown@mira.net RDBrown@mira.net
Thu Apr 12 17:59:00 GMT 2001


>>   In message < E14mbIB-000055-00@urtur >you write:
>> This fixes the two strip test failures when testing with objects
>> built with the unbundled HP ANSI C compiler.
>> R_COMMENT and R_COMP3 have the same som_fixup_formats value, but as
>> far as I can see the subop value setup in the code below is unused
>> anyway else - so that that 'O' fixup_format case may be incomplete.
>>    The GPL-ed som-linker up at < http://www.thepuffingroup.com > has code for
>> supporting R_COMP? and R_COMMENT in lieu of a SOM manual.

>> 2001-04-09  Rodney Brown  <RBrown64@csc.com.au>

>> 	* som.c (som_set_reloc_info): Support R_COMMENT for HP C.
> This can't be right -- the values in comp?_opcodes are specific to
> R_COMP1, R_COMP2 and R_COMP3.  Trying to use them for R_COMMENT
> make no sense at all.

> In fact, given the transparent nature of R_COMMENT we may be
> better off just saying there's 5 bytes of unknown data after the
> R_COMMENT fixup request.

static const struct fixup_format som_fixup_formats[256] = {
...
  /* R_COMP3 */
  0,    "Ob=Ve=",       /* 0xd2 */
...
  /* R_COMMENT */
  0,    "Ob=Ve=",       /* 0xdd */

...
static unsigned int
som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
...
            case 'O':
              switch (op)
                {
                case R_COMP1:
                  subop = comp1_opcodes;
                  break;
                case R_COMP2:
                  subop = comp2_opcodes;
                  break;
                case R_COMP3:
                  subop = comp3_opcodes;   
                  break;
                default:
                  abort ();
                }
              while (*subop <= (unsigned char) c)
                ++subop;
              --subop;
              break;

I looked at the preprocessed output for any further use of subop,
and didn't see any, which is why I assumed that if R_COMP3 & R_COMMENT
share the same som_fixup_format value they could share the same code.



More information about the Binutils mailing list