Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quentin@chrystal ~/linux-2.6 $ cat test.S 0
- #define alt_max_short(a, b) ((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
- .pushsection .text, "ax"
- .globl main
- main:
- // zero padding
- .skip -((alt_max_short(1, 2) - 3) > 0) * \
- (alt_max_short(1, 2) - 3),0x01
- // one byte padding
- .skip -((alt_max_short(1, 3) - (2)) > 0) * \
- (alt_max_short(1, 3) - (2)),0x02
- // zero padding
- .skip -((alt_max_short(2, 1) - (3)) > 0) * \
- (alt_max_short(2, 1) - (3)),0x03
- // two bytes padding
- .skip -((alt_max_short(2, 3) - (1)) > 0) * \
- (alt_max_short(2, 3) - (1)),0x04
- // one byte padding
- .skip -((alt_max_short(3, 1) - (2)) > 0) * \
- (alt_max_short(3, 1) - (2)),0x05
- // two bytes padding
- .skip -((alt_max_short(3, 2) - (1)) > 0) * \
- (alt_max_short(3, 2) - (1)),0x06
- // three bytes padding
- .skip -((alt_max_short(3, 2) - (0)) > 0) * \
- (alt_max_short(3, 2) - (0)),0x07
- // two bytes padding
- .skip -((alt_max_short(3, 0) - (1)) > 0) * \
- (alt_max_short(3, 0) - (1)),0x08
- .popsection
- quentin@chrystal ~/linux-2.6 $ gcc -c test.S -o test.o 0
- test.S: Assembler messages:
- test.S:8: Warning: .space repeat count is zero, ignored
- test.S:14: Warning: .space repeat count is zero, ignored
- quentin@chrystal ~/linux-2.6 $ objdump -j .text -s test.o 0
- test.o: file format elf64-x86-64
- Contents of section .text:
- 0000 02040405 06060707 070808 ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement