I am doing Linux assembly and I understand that is has a flat memory model. What I am confused about is NEAR and FAR JMPs.
NEAR is in the same segment while FAR is anot
From what I understand there are no segments in linux virtual memory?
It's accurate enough. There are thread-specific data with a location pointed by %fs
segment base, but there is no segments suitable for far jumps.
Also how do we know if my program's code is laid out in multiple segments?
If your target platform is Linux, you already know it is not. (I would be surprised if any modern OS still uses segments in a way which makes jump far
make sense).