Use relocation enumerations rather than hard-coded values for relocation types

(these were causing problems due to the enumeration values having changed).
This commit is contained in:
David Given 2013-05-29 14:11:04 +01:00
parent fc1b3672a3
commit e0c121d6e6
2 changed files with 6 additions and 6 deletions

View file

@ -26,9 +26,9 @@ item_t keytab[] = {
0, EXTERN, 0, ".define", 0, EXTERN, 0, ".define",
0, EXTERN, 0, ".extern", 0, EXTERN, 0, ".extern",
0, DOT, 0, ".", 0, DOT, 0, ".",
0, DATA, 1, ".data1", 0, DATA, RELO1, ".data1",
0, DATA, 2, ".data2", 0, DATA, RELO2, ".data2",
0, DATA, 4, ".data4", 0, DATA, RELO4, ".data4",
0, ASCII, 0, ".ascii", 0, ASCII, 0, ".ascii",
0, ASCII, 1, ".asciz", 0, ASCII, 1, ".asciz",
0, ALIGN, 0, ".align", 0, ALIGN, 0, ".align",

View file

@ -293,16 +293,16 @@ valu_t val;
int n; int n;
{ {
switch (n) { switch (n) {
case 1: case RELO1:
emit1((int)val); break; emit1((int)val); break;
case 2: case RELO2:
#ifdef BYTES_REVERSED #ifdef BYTES_REVERSED
emit1(((int)val>>8)); emit1((int)val); emit1(((int)val>>8)); emit1((int)val);
#else #else
emit1((int)val); emit1(((int)val>>8)); emit1((int)val); emit1(((int)val>>8));
#endif #endif
break; break;
case 4: case RELO4:
#ifdef WORDS_REVERSED #ifdef WORDS_REVERSED
emit2((int)(val>>16)); emit2((int)(val)); emit2((int)(val>>16)); emit2((int)(val));
#else #else