John T:
"...but if there is a big lump of granite at 500ft in the third segment..."
Man, I hate those John
Point well taken, but wouldn't that be as per the operator to determine obstacle clearance? OP's question was on minimum legal flap retraction altitude which, I believe, is a certification question.
Bfisk:
"The ICAO doesn't have jurisdiction anywhere. They are an advisory body and it's up to each (member) state to adopt their standards and recommended practices as they see fit. You need to consult the laws that govern you, normally those where the aircraft or AOC are registered"
Concur.
Best,
GC