PATCH: Support IMAGE_SCN_ALIGN_XXXXBYTES
Nick Clifton
nickc@redhat.com
Wed Aug 1 17:12:00 GMT 2007
More information about the Binutils mailing list
Wed Aug 1 17:12:00 GMT 2007
- Previous message (by thread): New Irish PO file for 'ld' (version 2.16.93)
- Next message (by thread): PATCH: Support IMAGE_SCN_ALIGN_XXXXBYTES
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi H.J.
> This patch supports IMAGE_SCN_ALIGN_XXXXBYTES. OK to install?
Not quite...
> + case IMAGE_SCN_ALIGN_4BYTES:
> + case IMAGE_SCN_ALIGN_2BYTES:
> + case IMAGE_SCN_ALIGN_1BYTES:
> + section->alignment_power = (alignment_power >> 20) - 1;
I like this, but I do not like the presence of the magic number 20.
I think that using a macro would be better. eg:
section->alignment_power = IMAGE_SCN_ALIGN_NUMBER (alignment_power) - 1;
And then in pe.h....
/* Bit position in the s_flags field where the alignment values start. */
#define IMAGE_SCN_ALIGN_BIT_POS 20
#define IMAGE_SCN_ALIGN_NUMBER(val) ((val) >> IMAGE_SCN_ALIGN_BIT_POS)
#define IMAGE_SCN_ALIGN_CONSTANT(val) ((val) << IMAGE_SCN_ALIGN_BIT_POS)
#define IMAGE_SCN_ALIGN_1BYTES IMAGE_SCN_ALIGN_CONSTANT(1)
#define IMAGE_SCN_ALIGN_2BYTES IMAGE_SCN_ALIGN_CONSTANT(2)
...
#define IMAGE_SCN_ALIGN_8129BYTES IMAGE_SCN_ALIGN_CONSTANT(15)
Cheers
Nick
- Previous message (by thread): New Irish PO file for 'ld' (version 2.16.93)
- Next message (by thread): PATCH: Support IMAGE_SCN_ALIGN_XXXXBYTES
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list