Menu

#3558 Wrong area flag handling in linker

closed-rejected
None
sdld
5
2023-02-21
2023-02-21
mi-chi
No

Codebase: sdcc-code-r13893
In \sdas\linksrc\aslink.h, some constants are defined for area and other flags, e.g.:

...

* Area flags
 *
 *         7     6     5     4     3     2     1     0
 *      +-----+-----+-----+-----+-----+-----+-----+-----+
 *      |     |     |     | PAG | ABS | OVR |     |     |
 *      +-----+-----+-----+-----+-----+-----+-----+-----+
 */
#define A3_CON    000           /* concatenate */
#define A3_OVR    004           /* overlay */
#define A3_REL    000           /* relocatable */
#define A3_ABS    010           /* absolute */
#define A3_NOPAG  000           /* non-paged */
#define A3_PAG    020           /* paged */

and some more (e.g. A_DATA)) in the same file

These flags are used elsewhere, e.g. in sdas\linksrc\lklist.c:

...
                if (xp->a_flag & A3_OVR) {
                        fprintf(mfp, ",OVR");
                } else {
...

Shouldn't all those flag numbers be HEXADECIMAL, with a leading "0x", i.e. "#define A3_OVR 0x004"???

Discussion

  • Philipp Klaus Krause

    I don't see the bug here. While I don't know why octal was used for these, it shouldn't be a problem. So, IMO we shouldn't change it, as that would unnecessarily increase the diff to upstream asxxxx.

     
  • Maarten Brock

    Maarten Brock - 2023-02-21
    • status: open --> closed-rejected
    • assigned_to: Maarten Brock
    • Category: other --> sdld
     
  • Maarten Brock

    Maarten Brock - 2023-02-21

    The original uses octal notation and we do not intend to change that.

     
  • mi-chi

    mi-chi - 2023-02-21

    Ah, now I get it. Not decimal... xD

     

Log in to post a comment.

Auth0 Logo