IDA will try to shrink/expand the previous segment in order to move the beginning of the selected segment. Of course, you cannot move the start of the segment 'too far':
- the segment must have at least 1 byte - the start address of the segment must be less than the end of the segment - no segments can be killed during moving - the segment cannot have bytes with negative offsetsYou cannot shrink a segment to zero bytes. A segment must have at least one byte.
This command is mostly used when IDA does not detect the boundary between segments correctly.
Sometimes, IDA creates 2 segments where only one segment must exist. In this case, you should not use this command. Use the following sequence instead:
- delete one segment. Choose the one with the bad segment base value. Do not disable addresses occupied by the segment being deleted. - change boundaries of the other segment.Caution: moving the first segment of the program will delete all information about the bytes between the old start of the segment and the new start of the segment!
See also another command that changes segment bounds:
Edit Segment Edit|Segments submenu.